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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/run_command.c b/components/run_command.c
index 942f3c4..93bf6da 100644
--- a/components/run_command.c
+++ b/components/run_command.c
@@ -15,17 +15,17 @@ run_command(const char *cmd)
warn("popen '%s':", cmd);
return NULL;
}
+
p = fgets(buf, sizeof(buf) - 1, fp);
if (pclose(fp) < 0) {
warn("pclose '%s':", cmd);
return NULL;
}
- if (!p) {
+ if (!p)
return NULL;
- }
- if ((p = strrchr(buf, '\n'))) {
+
+ if ((p = strrchr(buf, '\n')))
p[0] = '\0';
- }
return buf[0] ? buf : NULL;
}