aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-12-22 00:29:43 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-12-22 00:29:43 +0100
commit1deac31eba752536769e6eb48cee514d9ec85819 (patch)
tree905ef48e551e9695ecc552a6178cac924b2c04ef
parentbf468fb58950480289450b94943f1dec0185f739 (diff)
Curl_pp_readresp: replace stupid loop with memcpy
-rw-r--r--lib/pingpong.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/pingpong.c b/lib/pingpong.c
index 1b2ccd9b5..eca385e48 100644
--- a/lib/pingpong.c
+++ b/lib/pingpong.c
@@ -376,10 +376,8 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
if(pp->endofresp(conn, pp->linestart_resp, perline, code)) {
/* 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 */
- char *meow;
- int n;
- for(meow=pp->linestart_resp, n=0; meow<ptr; meow++, n++)
- buf[n] = *meow;
+ size_t n = ptr - pp->linestart_resp;
+ memcpy(buf, pp->linestart_resp, n);
buf[n]=0; /* zero terminate */
keepon=FALSE;
pp->linestart_resp = ptr+1; /* advance pointer */