fixed a segfault in auth/as because it didn't check to see if argv[0] and argv[1] actually had things in them
This commit is contained in:
parent
9abafe226e
commit
a84c51a1e3
1 changed files with 5 additions and 2 deletions
|
@ -52,7 +52,10 @@ main(int argc, char *argv[])
|
|||
|
||||
initcap();
|
||||
srand(getpid()*time(0));
|
||||
runas(argv[0], argv[1]);
|
||||
if(argc >= 2)
|
||||
runas(argv[0], argv[1]);
|
||||
else
|
||||
usage();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -88,7 +91,7 @@ erealloc(void *p, ulong n)
|
|||
void
|
||||
usage(void)
|
||||
{
|
||||
fprint(2, "usage: %s [-c]\n", argv0);
|
||||
fprint(2, "usage: %s [-c] [user] [command]\n", argv0);
|
||||
exits("usage");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue