diff options
| author | Laslo Hunhold <dev@frign.de> | 2018-05-22 12:50:43 +0200 |
|---|---|---|
| committer | Aaron Marcher <me@drkhsh.at> | 2018-05-22 13:25:47 +0200 |
| commit | 9c9ce8a125f35bab61c829bdd58bdf77b8352d5e (patch) | |
| tree | 8b125c59ae63b8f99d5e79266c7cee63e5cb7886 | |
| parent | 825f637e20e98901447825ac44aa24859083fe00 (diff) | |
| download | slstatus-9c9ce8a125f35bab61c829bdd58bdf77b8352d5e.tar.gz | |
Check printf() for output errors
This way cases like
$ slstatus -s > /dev/full
are properly caught and the program terminated with the proper return
code.
| -rw-r--r-- | slstatus.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -102,7 +102,9 @@ main(int argc, char *argv[]) } if (sflag) { - printf("%s\n", status); + if (printf("%s\n", status) < 0) { + die("printf:"); + } } else { if (XStoreName(dpy, DefaultRootWindow(dpy), status) < 0) { die("XStoreName: Allocation failed"); |
