Sfoglia il codice sorgente

Properly handles files ending in a partial line.

dtrg 16 anni fa
parent
commit
594fb05c87
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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';