1 | --- src/motifutils.c.orig 2011-08-04 11:11:51.000000000 +0200 |
---|
2 | +++ src/motifutils.c 2011-08-04 10:57:01.000000000 +0200 |
---|
3 | @@ -121,7 +121,7 @@ |
---|
4 | |
---|
5 | i = 0; |
---|
6 | va_start(var, nchoices); |
---|
7 | - while ((s = va_arg(var, char *)) != NULL) { |
---|
8 | + while ((s = va_arg(var, char *)) != NULL && i<nchoices) { |
---|
9 | retval[i + 2] = XmCreatePushButton(retval[1], s, NULL, 0); |
---|
10 | i++; |
---|
11 | } |
---|
12 | @@ -169,7 +169,7 @@ |
---|
13 | i = 0; |
---|
14 | |
---|
15 | va_start(var, nchoices); |
---|
16 | - while ((s = va_arg(var, char *)) != NULL) { |
---|
17 | + while ((s = va_arg(var, char *)) != NULL && i<nchoices) { |
---|
18 | retval[i + 2] = XmCreatePushButton(retval[1], s, NULL, 0); |
---|
19 | i++; |
---|
20 | } |
---|
21 | @@ -1294,7 +1294,7 @@ |
---|
22 | XmNlabelString, str, |
---|
23 | XmNmnemonic, mnemonic, |
---|
24 | XmNsubMenuId, menu, |
---|
25 | - 0); |
---|
26 | + (char *)NULL); |
---|
27 | XmStringFree(str); |
---|
28 | if (help_anchor) { |
---|
29 | XtAddCallback(menu, XmNhelpCallback, (XtCallbackProc) HelpCB, |
---|