From 35e96b8deba8aae863cef32f2ea2a84ebf162472 Mon Sep 17 00:00:00 2001 From: "arg@mig29" Date: Mon, 27 Nov 2006 10:29:47 +0100 Subject: applied Jukka's patch preventing some cornercases and making the EOF error message correct --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 934bea4a..062f9d75 100644 --- a/main.c +++ b/main.c @@ -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: -- cgit v1.2.3