Date: 07/11/99
- Next message: Bug Database: "[PHP-DEV] Bug #1695 Updated: fgets read to few data (1 byte)"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: andreas.rieber <email protected>
Operating system: Linux (different Types)
PHP version: 3.0.11
PHP Bug Type: Other
Bug description: fgets read to few data (1 byte)
<?
$fp = fsockopen( "localhost", 7); // echo port
fputs( $fp, "12345 this fail 67890\n"); // send data
$string = fgets( $fp, 3); // read first 3 bytes
echo "$string\n"; // echo them
$string = fgets( $fp, 100); // read to LF
echo "$string\n"; // echo
fclose($fp);
?>
With php3.0.9, php3.0.11 it reads only 2 bytes and than byte 3 to LF.
I fix one line and it will work!
functions/fsock.c
615c615
< amount = MIN(amount, maxlen - 1);
--- > amount = MIN(amount, maxlen); /* - 1); */-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] Bug #1695 Updated: fgets read to few data (1 byte)"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

