mirror of
https://github.com/pikami/slstatus.git
synced 2024-11-27 22:05:42 +00:00
fix overflow in run_command()
This commit is contained in:
parent
b2714032e5
commit
c288663ebd
@ -451,7 +451,7 @@ run_command(const char *cmd)
|
|||||||
pclose(fp);
|
pclose(fp);
|
||||||
buf[sizeof(buf) - 1] = '\0';
|
buf[sizeof(buf) - 1] = '\0';
|
||||||
|
|
||||||
if ((nlptr = strstr(buf, "\n")) != NULL) {
|
if ((nlptr = strrchr(buf, '\n')) != NULL) {
|
||||||
nlptr[0] = '\0';
|
nlptr[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user