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);
|
||||
|
||||
for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
|
||||
pe = emalloc(sizeof(*pe));
|
||||
pe->pid = estrtol(p, 10);
|
||||
SLIST_INSERT_HEAD(&omitpid_head, pe, entry);
|
||||
if (oflag) {
|
||||
for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
|
||||
pe = emalloc(sizeof(*pe));
|
||||
pe->pid = estrtol(p, 10);
|
||||
SLIST_INSERT_HEAD(&omitpid_head, pe, entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (sig != SIGSTOP && sig != SIGCONT)
|
||||
|
|
Loading…
Reference in New Issue