X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/37959ca569a4bf69c6c1bbb16991cfc6d8452970..db07244cb805c6c58b68e1aeed203c651976f034:/slstatus.c?ds=inline diff --git a/slstatus.c b/slstatus.c index 99ef720..fa12572 100644 --- a/slstatus.c +++ b/slstatus.c @@ -90,7 +90,7 @@ smprintf(const char *fmt, ...) ret = malloc(++len); if (ret == NULL) { warn("Malloc failed."); - exit(1); + return "n/a"; } va_start(ap, fmt); @@ -406,7 +406,7 @@ static char * run_command(const char *cmd) { FILE *fp; - char buf[64] = "\0"; + char buf[64] = "n/a"; fp = popen(cmd, "r"); if (fp == NULL) { @@ -599,8 +599,6 @@ usage(void) exit(1); } - - int main(int argc, char *argv[]) {