summaryrefslogtreecommitdiff
path: root/components/run_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/run_command.c')
-rw-r--r--components/run_command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/run_command.c b/components/run_command.c
index e356620..1aaae20 100644
--- a/components/run_command.c
+++ b/components/run_command.c
@@ -17,10 +17,12 @@ run_command(const char *cmd)
}
p = fgets(buf, sizeof(buf) - 1, fp);
pclose(fp);
- if (!p)
+ if (!p) {
return NULL;
- if ((p = strrchr(buf, '\n')) != NULL)
+ }
+ if ((p = strrchr(buf, '\n'))) {
p[0] = '\0';
+ }
return buf[0] ? buf : NULL;
}