summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-11-02 17:07:14 +0100
committerAnselm R. Garbe <garbeam@gmail.com>2007-11-02 17:07:14 +0100
commitaf4667a85a11a1c001e60894a7ec7458c208bc0d (patch)
treea56a0218f6daac99481ce6dba9e7a4d52aabd353 /dwm.c
parentmade error handling more proper (diff)
downloaddwm-af4667a85a11a1c001e60894a7ec7458c208bc0d.tar.gz
dwm-af4667a85a11a1c001e60894a7ec7458c208bc0d.zip
simplified
Diffstat (limited to '')
-rw-r--r--dwm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/dwm.c b/dwm.c
index c595a51..266dd15 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1300,15 +1300,12 @@ run(void) {
1300 eprint("select failed\n"); 1300 eprint("select failed\n");
1301 } 1301 }
1302 if(FD_ISSET(STDIN_FILENO, &rd)) { 1302 if(FD_ISSET(STDIN_FILENO, &rd)) {
1303 if(stext == fgets(stext, sizeof stext - 1, stdin)) 1303 if((readin = (stext == fgets(stext, sizeof stext - 1, stdin))))
1304 stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */ 1304 stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */
1305 else { 1305 else if(feof(stdin))
1306 readin = False; 1306 strncpy(stext, "EOF", 4);
1307 if(feof(stdin)) 1307 else /* error occured */
1308 strncpy(stext, "EOF", 4); 1308 strncpy(stext, strerror(errno), sizeof stext - 1);
1309 else /* error occured */
1310 strncpy(stext, strerror(errno), sizeof stext - 1);
1311 }
1312 drawbar(); 1309 drawbar();
1313 } 1310 }
1314 while(XPending(dpy)) { 1311 while(XPending(dpy)) {