projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
825f637
)
Check printf() for output errors
author
Laslo Hunhold
<dev@frign.de>
Tue, 22 May 2018 10:50:43 +0000
(12:50 +0200)
committer
Aaron Marcher
<me@drkhsh.at>
Tue, 22 May 2018 11:25:47 +0000
(13:25 +0200)
This way cases like
$ slstatus -s > /dev/full
are properly caught and the program terminated with the proper return
code.
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index b3abafb43b103d293aca54436b89dbe6c3044107..9bd9e81188e51626647ca6aff0b6ea9a4c3bc52e 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-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");