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.
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