martin 99/07/30 07:06:57
Modified: src/main rfc1413.c Log: An important bit I missed in the previous commit: When looking for the end-of-line, we have to scan for '\012' (instead of '\n' which on EBCDIC platforms differs from '\012') because at this stage the line is still raw ASCII. Thanks to David for reminding me of the omission! Submitted by: David McCreedy <[EMAIL PROTECTED]> Revision Changes Path 1.29 +6 -2 apache-1.3/src/main/rfc1413.c Index: rfc1413.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/rfc1413.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- rfc1413.c 1999/07/30 13:42:25 1.28 +++ rfc1413.c 1999/07/30 14:06:56 1.29 @@ -171,8 +171,12 @@ */ i = 0; - memset(buffer, 0, sizeof(buffer)); - while((cp = strchr(buffer, '\n')) == NULL && i < sizeof(buffer) - 1) { + memset(buffer, '\0', sizeof(buffer)); + /* + * Note that the strchr function below checks for 10 instead of '\n' + * this allows it to work on both ASCII and EBCDIC machines. + */ + while((cp = strchr(buffer, '\012')) == NULL && i < sizeof(buffer) - 1) { int j; j = read(sock, buffer+i, (sizeof(buffer) - 1) - i); if (j < 0 && errno != EINTR) {