diff options
author | Aaron Marcher <info@nulltime.net> | 2016-08-15 13:08:34 +0200 |
---|---|---|
committer | Aaron Marcher (drkhsh) <info@nulltime.net> | 2016-08-15 13:08:34 +0200 |
commit | 4170970c85da252ee2061f81520581fb71f5e149 (patch) | |
tree | 1a8990723e8fe8e674ddea0643c515e5e7a0c1aa | |
parent | df928892e8dd689416cab464cc05284997c0c188 (diff) |
fixed strcat null possibility in main()
-rw-r--r-- | slstatus.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |