1
0
Fork 0

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.
This commit is contained in:
Laslo Hunhold 2018-05-22 12:50:43 +02:00 committed by Aaron Marcher
parent 825f637e20
commit 9c9ce8a125

View file

@ -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");