]> git.draconx.ca Git - dxcommon.git/blobdiff - src/help.c
help: Improve compatibility with old compilers.
[dxcommon.git] / src / help.c
index 3886c272ac6e4cd5145b4f17462f66a28ccee9f0..2e6043bea760b74c58d3b644358f48808a768324 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2021-2023 Nick Bowler
+ * Copyright © 2021-2024 Nick Bowler
  *
  * Helper functions for formatting --help program output.
  *
@@ -72,7 +72,7 @@ enum {
        OPT_SHORT_WITHOUT_ARG        = 4,
        OPT_LONG_WITH_OPTIONAL_ARG   = 2,
        OPT_LONG_WITH_MANDATORY_ARG  = 1,
-       OPT_LONG_WITHOUT_ARG         = 0,
+       OPT_LONG_WITHOUT_ARG         = 0
 };
 
 #if HELP_GETOPT_LONG_ONLY
@@ -183,7 +183,7 @@ no_translate:
                w = printf(fmt, opt->name, argname);
        }
 out:
-       if (w < 0 || w > l) {
+       if (w <= 0 || w > l) {
                putchar('\n');
                return 0;
        }