mirror of git://git.suckless.org/ubase
Fix segfault in killall5 without -o
Original patch by Platon Ryzhikov <ihummer63@yandex.ru>
This commit is contained in:
parent
2d58716c23
commit
11d2d1faaf
10
killall5.c
10
killall5.c
|
@ -73,10 +73,12 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
SLIST_INIT(&omitpid_head);
|
SLIST_INIT(&omitpid_head);
|
||||||
|
|
||||||
for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
|
if (oflag) {
|
||||||
pe = emalloc(sizeof(*pe));
|
for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
|
||||||
pe->pid = estrtol(p, 10);
|
pe = emalloc(sizeof(*pe));
|
||||||
SLIST_INSERT_HEAD(&omitpid_head, pe, entry);
|
pe->pid = estrtol(p, 10);
|
||||||
|
SLIST_INSERT_HEAD(&omitpid_head, pe, entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sig != SIGSTOP && sig != SIGCONT)
|
if (sig != SIGSTOP && sig != SIGCONT)
|
||||||
|
|
Loading…
Reference in New Issue