diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c index 0f7fba18da55..aa0dd26ffebf 100644 --- a/usr.bin/pkill/pkill.c +++ b/usr.bin/pkill/pkill.c @@ -1,4 +1,4 @@ -/* $NetBSD: pkill.c,v 1.30 2015/01/09 12:45:32 prlw1 Exp $ */ +/* $NetBSD: pkill.c,v 1.31 2017/02/21 13:09:56 kre Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: pkill.c,v 1.30 2015/01/09 12:45:32 prlw1 Exp $"); +__RCSID("$NetBSD: pkill.c,v 1.31 2017/02/21 13:09:56 kre Exp $"); #endif /* !lint */ #include @@ -296,8 +296,10 @@ main(int argc, char **argv) pargv[0]); pargv++; } - } else + } else if (pargv[0] != NULL) strlcpy(buf, pargv[0], sizeof(buf)); + else + strlcpy(buf, kp->p_comm, sizeof(buf)); rv = regexec(®, buf, 1, ®match, 0); if (rv == 0) {