Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
| inline |
side by side
load_ieee80211_nodereq: Fix typo
[slstatus.git]
/
components
/
run_command.c
diff --git
a/components/run_command.c
b/components/run_command.c
index
e356620
..
1aaae20
100644
(file)
--- 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;
}