about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index 934bea4..062f9d7 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: