fix printing out help message (list of command line options) (tiny change)
authorChris Rorvick <>
Fri, 9 Oct 2009 06:46:52 +0000 (23:46 -0700)
committerArun Persaud <arun@nubati.net>
Fri, 9 Oct 2009 07:13:44 +0000 (00:13 -0700)
The postfix increment always resulted in an attempt to print out an
option on the right side regardless of one actually existing. Use
prefix increment to prevent a crash when printing an odd number of
options.

xboard.c

index 64ac34f..1e0e7a8 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -2427,7 +2427,7 @@ main(argc, argv)
            j = fprintf(stderr, "  %s%s", shellOptions[i].option,
                        (shellOptions[i].argKind == XrmoptionSepArg
                         ? " ARG" : ""));
-           if (i++ < XtNumber(shellOptions)) {         
+           if (++i < XtNumber(shellOptions)) {         
                fprintf(stderr, "%*c%s%s\n", 40 - j, ' ',
                        shellOptions[i].option,
                        (shellOptions[i].argKind == XrmoptionSepArg