]> git.sesse.net Git - plocate/blobdiff - plocate.cpp
Remove some unneeded whitespace.
[plocate] / plocate.cpp
index 9f3928b1a8349e8db0e57d82bb31fd8df59171ef..de7bd7a0eafc1073b1bfdc72b53166f88d0535ea 100644 (file)
@@ -668,6 +668,10 @@ int main(int argc, char **argv)
                case 'l':
                case 'n':
                        limit_matches = atoll(optarg);
+                       if (limit_matches <= 0) {
+                               fprintf(stderr, "Error: limit must be a strictly positive number.\n");
+                               exit(1);
+                       }
                        break;
                case '0':
                        print_nul = true;
@@ -705,7 +709,6 @@ int main(int argc, char **argv)
                Needle needle;
                needle.str = argv[i];
 
-
                // See if there are any wildcard characters, which indicates we should treat it
                // as an (anchored) glob.
                bool any_wildcard = false;