--- src/motifutils.c.orig 2011-08-04 11:11:51.000000000 +0200
+++ src/motifutils.c 2011-08-04 10:57:01.000000000 +0200
- while ((s = va_arg(var, char *)) != NULL) {
+ while ((s = va_arg(var, char *)) != NULL && i<nchoices) {
retval[i + 2] = XmCreatePushButton(retval[1], s, NULL, 0);
- while ((s = va_arg(var, char *)) != NULL) {
+ while ((s = va_arg(var, char *)) != NULL && i<nchoices) {
retval[i + 2] = XmCreatePushButton(retval[1], s, NULL, 0);
XtAddCallback(menu, XmNhelpCallback, (XtCallbackProc) HelpCB,