diff --git a/usr.sbin/jls/jls.c b/usr.sbin/jls/jls.c index a3a23b77936..2c1655b771e 100644 --- a/usr.sbin/jls/jls.c +++ b/usr.sbin/jls/jls.c @@ -84,8 +84,10 @@ main(int argc, char **argv) break; case 'j': jid = strtoul(optarg, &ep, 10); - if (!*optarg || *ep) + if (!jid || *ep) { + jid = 0; jname = optarg; + } break; case 'h': pflags = (pflags & ~(PRINT_SKIP | PRINT_VERBOSE)) |