mirror of
https://github.com/curl/curl.git
synced 2026-07-22 22:37:16 +03:00
Curl_pp_readresp: replace stupid loop with memcpy
This commit is contained in:
parent
bf468fb589
commit
1deac31eba
1 changed files with 2 additions and 4 deletions
|
|
@ -376,10 +376,8 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
|
||||||
if(pp->endofresp(conn, pp->linestart_resp, perline, code)) {
|
if(pp->endofresp(conn, pp->linestart_resp, perline, code)) {
|
||||||
/* This is the end of the last line, copy the last line to the
|
/* This is the end of the last line, copy the last line to the
|
||||||
start of the buffer and zero terminate, for old times sake */
|
start of the buffer and zero terminate, for old times sake */
|
||||||
char *meow;
|
size_t n = ptr - pp->linestart_resp;
|
||||||
int n;
|
memcpy(buf, pp->linestart_resp, n);
|
||||||
for(meow=pp->linestart_resp, n=0; meow<ptr; meow++, n++)
|
|
||||||
buf[n] = *meow;
|
|
||||||
buf[n]=0; /* zero terminate */
|
buf[n]=0; /* zero terminate */
|
||||||
keepon=FALSE;
|
keepon=FALSE;
|
||||||
pp->linestart_resp = ptr+1; /* advance pointer */
|
pp->linestart_resp = ptr+1; /* advance pointer */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue