]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Print help when no arguments supplied to minideflate.
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 11 Mar 2022 23:42:14 +0000 (15:42 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 17 Mar 2023 20:27:56 +0000 (21:27 +0100)
test/minideflate.c

index 44c79e3fc185b52df939aec338cc00ce0f062b71..0c452635ff92a255573194b2ecc1db90a12bdf19 100644 (file)
@@ -241,6 +241,12 @@ int main(int argc, char **argv) {
     FILE *fin = stdin;
     FILE *fout = stdout;
 
+
+    if (argc == 1) {
+        show_help();
+        return 64;   /* EX_USAGE */
+    }
+
     for (i = 1; i < argc; i++) {
         if ((strcmp(argv[i], "-m") == 0) && (i + 1 < argc))
             mem_level = atoi(argv[++i]);