simplified
af4667a8
1 file(s) · +5 −8
| 1300 | 1300 | eprint("select failed\n"); |
|
| 1301 | 1301 | } |
|
| 1302 | 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 | 1304 | stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */ |
|
| 1305 | - | else { |
|
| 1306 | - | readin = False; |
|
| 1307 | - | if(feof(stdin)) |
|
| 1308 | - | strncpy(stext, "EOF", 4); |
|
| 1309 | - | else /* error occured */ |
|
| 1310 | - | strncpy(stext, strerror(errno), sizeof stext - 1); |
|
| 1311 | - | } |
|
| 1305 | + | else if(feof(stdin)) |
|
| 1306 | + | strncpy(stext, "EOF", 4); |
|
| 1307 | + | else /* error occured */ |
|
| 1308 | + | strncpy(stext, strerror(errno), sizeof stext - 1); |
|
| 1312 | 1309 | drawbar(); |
|
| 1313 | 1310 | } |
|
| 1314 | 1311 | while(XPending(dpy)) { |