瀏覽代碼

Properly handles files ending in a partial line.

dtrg 16 年之前
父節點
當前提交
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';