Просмотр исходного кода

Properly handles files ending in a partial line.

dtrg 16 лет назад
Родитель
Сommit
594fb05c87
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      mach/proto/top/top.c

+ 2 - 0
mach/proto/top/top.c

@@ -562,6 +562,8 @@ instr_p read_instr()
 			return ip;
 		}
 		c = getc(inp);
+		if (c == EOF)
+			break;
 	}
 	ungetc(c,inp);
 	*p = '\0';