Index: ipcd356.c =================================================================== --- ipcd356.c (revision 29522) +++ ipcd356.c (revision 29523) @@ -450,10 +450,11 @@ if (f == NULL) return 0; - while(!feof(f)) { + for(;;) { char *s, line[1024]; s = fgets(line, sizeof(line), f); - + if (s == NULL) + break; if ((strncmp(s, "999", 3) == 0) && (isspace(s[3]))) { fclose(f); return 100;