summaryrefslogtreecommitdiff
path: root/slstatus.c
diff options
context:
space:
mode:
Diffstat (limited to 'slstatus.c')
-rw-r--r--slstatus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/slstatus.c b/slstatus.c
index d993eca..b74faa6 100644
--- 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);