From 0bca6aec07ae68fd49bd722f97bdfb96ffcd26ca Mon Sep 17 00:00:00 2001 From: Chris Rorvick <> Date: Thu, 8 Oct 2009 23:46:52 -0700 Subject: [PATCH] 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. --- xboard.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 -- 1.7.0.4