1 | --- src/motifutils.c.orig 2011-01-30 19:39:41.000000000 +0100 |
---|
2 | +++ src/motifutils.c 2011-04-29 14:00:06.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 | } |
---|