cvs: php4 /ext/curl curl.c

From: Date: Mon, 11 Sep 2000 03:33:15 +0000
Subject: cvs: php4 /ext/curl curl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1688@lists.php.net to get a copy of this message
sterling Sun Sep 10 20:33:15 2000 EDT Modified files: /php4/ext/curl curl.c Log: @- Fix bug with curl places extra data in the output. (medvitz@medvitz.net) Index: php4/ext/curl/curl.c diff -u php4/ext/curl/curl.c:1.12 php4/ext/curl/curl.c:1.13 --- php4/ext/curl/curl.c:1.12 Sun Aug 27 15:53:33 2000 +++ php4/ext/curl/curl.c Sun Sep 10 20:33:14 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: curl.c,v 1.12 2000/08/27 22:53:33 sterling Exp $ */ +/* $Id: curl.c,v 1.13 2000/09/11 03:33:14 sterling Exp $ */ #include "php.h" @@ -348,6 +348,7 @@ FILE *fp; char buf[4096]; int b; + unsigned long pos = 0; CURLLS_FETCH(); @@ -408,8 +409,10 @@ ret_data = emalloc((stat_sb.st_size+1)*sizeof(char)); while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) { - strcat(ret_data, buf); + memcpy(&(ret_data[pos]), buf, b); + pos += b; } + ret_data[stat_sb.st_size - 1] = '\0'; RETURN_STRINGL(ret_data, stat_sb.st_size, 0);

« previous php.cvs (#1688) next »