dwm-meillo

diff main.c @ 583:f4285a97e3e6

applied Jukka's patch preventing some cornercases and making the EOF error message correct
author arg@mig29
date Mon, 27 Nov 2006 10:29:47 +0100
parents 70472540c443
children f617c75a8405
line diff
     1.1 --- a/main.c	Sun Nov 26 15:43:16 2006 +0100
     1.2 +++ b/main.c	Mon Nov 27 10:29:47 2006 +0100
     1.3 @@ -277,10 +277,11 @@
     1.4  			switch(r = read(STDIN_FILENO, stext, sizeof stext - 1)) {
     1.5  			case -1:
     1.6  				strncpy(stext, strerror(errno), sizeof stext - 1);
     1.7 +				stext[sizeof stext - 1] = '\0';
     1.8  				readin = False;
     1.9  				break;
    1.10  			case 0:
    1.11 -				strncpy(stext, "EOF", sizeof stext);
    1.12 +				strncpy(stext, "EOF", 4);
    1.13  				readin = False;
    1.14  				break;
    1.15  			default: