Fix stupid bugs. update was segfaulting. mknod minor # was always 0

due to a parsing bug.  Oops.
 -Erik
This commit is contained in:
Erik Andersen 2000-04-28 22:10:34 +00:00
parent abc199eb0c
commit 6ed02a0ee0
5 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,8 @@
* Added mktemp, contributed by Daniel Jacobowitz <dan@debian.org>
* Fix for ping warnings from Sascha Ziemann <szi@aibon.ping.de>
* More doc updates
* Fixed update segfault
* Fixed mknod -- minor number was always 0
0.43

View File

@ -58,6 +58,7 @@ int mknod_main(int argc, char **argv)
argc--;
argv++;
parse_mode(*argv, &perm);
umask(0);
break;
default:
usage(mknod_usage);
@ -87,7 +88,7 @@ int mknod_main(int argc, char **argv)
}
if (mode == S_IFCHR || mode == S_IFBLK) {
dev = (atoi(argv[2]) << 8) | atoi(argv[1]);
dev = (atoi(argv[2]) << 8) | atoi(argv[3]);
}
mode |= perm;

View File

@ -52,7 +52,7 @@ extern int update_main(int argc, char **argv)
argc--;
argv++;
while (**argv == '-') {
while (argc>0 && **argv == '-') {
while (*++(*argv)) {
switch (**argv) {
case 'S':

View File

@ -58,6 +58,7 @@ int mknod_main(int argc, char **argv)
argc--;
argv++;
parse_mode(*argv, &perm);
umask(0);
break;
default:
usage(mknod_usage);
@ -87,7 +88,7 @@ int mknod_main(int argc, char **argv)
}
if (mode == S_IFCHR || mode == S_IFBLK) {
dev = (atoi(argv[2]) << 8) | atoi(argv[1]);
dev = (atoi(argv[2]) << 8) | atoi(argv[3]);
}
mode |= perm;

View File

@ -52,7 +52,7 @@ extern int update_main(int argc, char **argv)
argc--;
argv++;
while (**argv == '-') {
while (argc>0 && **argv == '-') {
while (*++(*argv)) {
switch (**argv) {
case 'S':