PHP 4.0 Bug #6419 Updated: Curl output has extra data in output
| From: | Bug Database | Date: | Mon, 11 Sep 2000 03:48:38 +0000 |
| Subject: | PHP 4.0 Bug #6419 Updated: Curl output has extra data in output | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32867@lists.php.net to get a copy of this message | ||
ID: 6419
Updated by: sterling
Reported By: medvitz@medvitz.net
Status: Closed
Bug Type: cURL related
Assigned To:
Comments:
Fixed in CVS. Thanks!
Previous Comments:
---------------------------------------------------------------------------
[2000-09-10 23:02:12] medvitz@medvitz.net
I tracked down this problem. Basically, the strcat function was the culprit. In the curl_exec
function I added a unsigned long pos, and then changed the loop that looked like
while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
strcat(ret_data, buf);
}
to
pos = 0;
while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
memcpy(&(ret_data[pos]), buf,b);
pos += b;
}
ret_data[stat_sb.st_size-1]='