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.
Laslo Hunhold dev@frign.de
Tue, 22 May 2018 12:50:43 +0200
1 files changed,
3 insertions(+),
1 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -102,7 +102,9 @@ len += ret;
} 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");