diff options
author | maximilian attems <max@stro.at> | 2010-11-10 16:42:02 +0100 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2010-11-10 16:42:02 +0100 |
commit | da0ce3dde0b39ed2aaf4f61d2f1180f080dad45f (patch) | |
tree | 4827ada47924ed53d5f6faa15d969235cae49ec0 | |
parent | 8e5fba113bc02b5881033ee789d5149b4886ea35 (diff) | |
download | klibc-da0ce3dde0b39ed2aaf4f61d2f1180f080dad45f.tar.gz |
[klibc] utils: mknod massage
Show usage instead of segfaulting when no args are passed.
0d844078 added typec and assigned value without actually using it.
As variable is properly named just use it in coressponding switch.
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/utils/mknod.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/utils/mknod.c b/usr/utils/mknod.c index 14f8fddf00d8d..fa7ac7a68485d 100644 --- a/usr/utils/mknod.c +++ b/usr/utils/mknod.c @@ -20,6 +20,8 @@ int main(int argc, char *argv[]) dev_t dev; progname = *argv++; + if (argc == 1) + usage(); if (argv[0][0] == '-' && argv[0][1] == 'm' && !argv[0][2]) { mode_set = strtoul(argv[1], &endp, 8); @@ -36,7 +38,7 @@ int main(int argc, char *argv[]) typec = type[0]; mode = 0; - switch (type[0]) { + switch (typec) { case 'c': mode = S_IFCHR; break; |