Browse Source

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.
master
Laslo Hunhold 8 years ago
committed by Aaron Marcher
parent
commit
9c9ce8a125
  1. 4
      slstatus.c

4
slstatus.c

@ -102,7 +102,9 @@ main(int argc, char *argv[])
} }
if (sflag) { if (sflag) {
printf("%s\n", status); if (printf("%s\n", status) < 0) {
die("printf:");
}
} else { } else {
if (XStoreName(dpy, DefaultRootWindow(dpy), status) < 0) { if (XStoreName(dpy, DefaultRootWindow(dpy), status) < 0) {
die("XStoreName: Allocation failed"); die("XStoreName: Allocation failed");

Loading…
Cancel
Save