applied Jukka's patch preventing some cornercases and making the EOF error message correct
arg@mig29 unknown
Mon, 27 Nov 2006 10:29:47 +0100
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
main.c
→
main.c
@@ -277,10 +277,11 @@ if(FD_ISSET(STDIN_FILENO, &rd)) {
switch(r = read(STDIN_FILENO, stext, sizeof stext - 1)) { case -1: strncpy(stext, strerror(errno), sizeof stext - 1); + stext[sizeof stext - 1] = '\0'; readin = False; break; case 0: - strncpy(stext, "EOF", sizeof stext); + strncpy(stext, "EOF", 4); readin = False; break; default: