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:
df92889
)
fixed strcat null possibility in main()
author
Aaron Marcher
<info@nulltime.net>
Mon, 15 Aug 2016 11:08:34 +0000
(13:08 +0200)
committer
Aaron Marcher (drkhsh)
<info@nulltime.net>
Mon, 15 Aug 2016 11:08:34 +0000
(13:08 +0200)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index d993ecae84487cbbeaff2b776f123b39a4dc0fd5..b74faa685f1c598d7e15b1643ac8fa49d3a6facf 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-689,6
+689,10
@@
main(void)
argument = args[i];
char *res = argument.func(argument.args);
char *element = smprintf(argument.format, res);
+ if (element == NULL) {
+ element = smprintf("n/a");
+ fprintf(stderr, "Failed to format output.");
+ }
strcat(status_string, element);
free(res);
free(element);