#37920 [Opn->Csd]: Hardcoded ASCII values in cgi_main.c
ID: 37920
Updated by: tony2001@php.net
Reported By: agiorgio at optonline dot net
-Status: Open
+Status: Closed
Bug Type: *Compile Issues
Operating System: z/OS
PHP Version: 5.1.5CVS
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Fix committed to 5_2 and HEAD.
Previous Comments:
------------------------------------------------------------------------
[2006-06-26 23:22:24] agiorgio at optonline dot net
This code does not compile correctly on non-ASCII systems, like IBM
z/OS.
------------------------------------------------------------------------
[2006-06-26 21:36:39] tony2001@php.net
You forgot to explain what the problem is.
------------------------------------------------------------------------
[2006-06-26 21:23:41] agiorgio at optonline dot net
Description:
------------
There are hardcoded ASCII values in cgi_main.c. 0x10 should be '\n'
and 0x13 should be '\r'.
Reproduce code:
---------------
while (c != 10 && c != 13) {
c = fgetc(file_handle.handle.fp); /* skip to end of line */
}
/* handle situations where line is terminated by \r\n */
if (c == 13) {
if (fgetc(file_handle.handle.fp) != 10) {
long pos = ftell(file_handle.handle.fp);
fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37920&edit=1
Thread (4 messages)