]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
uuidd: fix -n usage
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 3 Feb 2011 14:04:58 +0000 (15:04 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Feb 2011 14:21:53 +0000 (15:21 +0100)
It does not make sense to request zero UUIDs - report error.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
misc-utils/uuidd.c

index 1315a7eb84d0565f008cb393f008a2b5af6a5a4a..97caa330010c45b54b5650a4c75583490141e04e 100644 (file)
@@ -438,7 +438,7 @@ int main(int argc, char **argv)
                        break;
                case 'n':
                        num = strtol(optarg, &tmp, 0);
-                       if ((num < 0) || *tmp) {
+                       if ((num < 1) || *tmp) {
                                fprintf(stderr, _("Bad number: %s\n"), optarg);
                                exit(1);
                        }