diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-17 19:13:45 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-05-17 19:13:45 +0000 |
commit | baf001d4b821770f90ee30aa994af9009c787688 (patch) | |
tree | 3aa6a10c00e045b34186329e42ca2c36d2e39a02 /bin/csh/proc.c | |
parent | 086076ee3c9d656911195e201d07c37f171ce07d (diff) |
do not advance pointer that free() will happen to
Diffstat (limited to 'bin/csh/proc.c')
-rw-r--r-- | bin/csh/proc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/csh/proc.c b/bin/csh/proc.c index b6c126b128b..dc9e0bb66a6 100644 --- a/bin/csh/proc.c +++ b/bin/csh/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.8 1998/05/13 06:50:14 deraadt Exp $ */ +/* $OpenBSD: proc.c,v 1.9 1998/05/17 19:13:44 deraadt Exp $ */ /* $NetBSD: proc.c,v 1.9 1995/04/29 23:21:33 mycroft Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: proc.c,v 1.8 1998/05/13 06:50:14 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: proc.c,v 1.9 1998/05/17 19:13:44 deraadt Exp $"; #endif #endif /* not lint */ @@ -1008,23 +1008,24 @@ dokill(v, t) stderror(ERR_NAME | ERR_BADSIG); } else { - if (v[0][1] == 's' && (Isspace(v[0][2]) || v[0][2] == '\0')) + if (v[0][1] == 's' && (Isspace(v[0][2]) || v[0][2] == '\0')) { v++; - else - (*v)++; + name = short2str(&v[0][0]); + } else { + name = short2str(&v[0][1]); + } if (v[0] == NULL || v[1] == NULL) { stderror(ERR_NAME | ERR_TOOFEW); return; } - name = short2str(&v[0][0]); for (signum = 1; signum < NSIG; signum++) if (!strcasecmp(sys_signame[signum], name)) break; if (signum == NSIG) { - if (v[0][0] == '0') + if (name[0] == '0') signum = 0; else { setname(vis_str(&v[0][0])); |