diff -Nur hugs98-Dec2001/src/input.c hugs98-Dec2001_patched/src/input.c --- hugs98-Dec2001/src/input.c 2001-12-13 06:25:55.000000000 +0100 +++ hugs98-Dec2001_patched/src/input.c 2002-07-29 12:29:16.000000000 +0200 @@ -511,10 +511,14 @@ /* Returns line length (including \n) or 0 upon EOF. */ static Int local nextLine() { + int char_code; for (lineLength = 0; lineLength < LINEBUFFER_SIZE-1; lineLength++) { - lineBuffer[lineLength] = fgetc(inputStream); - if (lineBuffer[lineLength] == EOF) + /* EOF is an int, so we can't cast to char right away. */ + char_code = fgetc(inputStream); + if (char_code == EOF) break; + + lineBuffer[lineLength] = (char) char_code; #if MULTI_LINEFEED if (lineBuffer[lineLength] == '\r') { char c = fgetc(inputStream);