From: Chris Rorvick <> Date: Fri, 9 Oct 2009 06:46:52 +0000 (-0700) Subject: fix printing out help message (list of command line options) (tiny change) X-Git-Tag: v4.4.1.20091019~49 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=0bca6aec07ae68fd49bd722f97bdfb96ffcd26ca fix printing out help message (list of command line options) (tiny change) 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. --- diff --git a/xboard.c b/xboard.c index 64ac34f..1e0e7a8 100644 --- 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