diff options
author | arg@mig29 <unknown> | 2006-11-27 10:29:47 +0100 |
---|---|---|
committer | arg@mig29 <unknown> | 2006-11-27 10:29:47 +0100 |
commit | 35e96b8deba8aae863cef32f2ea2a84ebf162472 (patch) | |
tree | f6c0496cb359471060d83b8ada7856938d5afa43 /main.c | |
parent | 2210ea7e3b0b2839ac7fb49c18d2731cb9e94e01 (diff) |
applied Jukka's patch preventing some cornercases and making the EOF error message correct
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -277,10 +277,11 @@ main(int argc, char *argv[]) { 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: |