summaryrefslogtreecommitdiff
path: root/components/run_command.c
diff options
context:
space:
mode:
authordrkhsh <me@drkhsh.at>2022-10-28 00:51:34 +0200
committerdrkhsh <me@drkhsh.at>2022-10-28 01:03:38 +0200
commit6c3cd320737419cc5e936a60f0f501b1edfa2ecf (patch)
treedc9b6927e963a994286babd803357615c9b37a22 /components/run_command.c
parent0c8ac6edf9ad50506465db3fb70535ab561e6872 (diff)
radical re-formatting 2/3: Fix blocks
Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
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;
}