fix overflow in run_command()
This commit is contained in:
parent
b2714032e5
commit
c288663ebd
1 changed files with 1 additions and 1 deletions
|
@ -451,7 +451,7 @@ run_command(const char *cmd)
|
|||
pclose(fp);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
|
||||
if ((nlptr = strstr(buf, "\n")) != NULL) {
|
||||
if ((nlptr = strrchr(buf, '\n')) != NULL) {
|
||||
nlptr[0] = '\0';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue