summaryrefslogtreecommitdiff
path: root/lwlib/lwlib-Xm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lwlib/lwlib-Xm.c')
-rw-r--r--lwlib/lwlib-Xm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 57e4b4a2ca5..7909bac7392 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -553,7 +553,9 @@ xm_update_menu (instance, widget, val, deep_p)
{
if (children)
{
- for (i = 0, cur = val->contents; i < num_children;
+ for (i = 0, cur = val->contents;
+ (i < num_children
+ && cur); /* how else to ditch unwanted children ?? - mgd */
i++, cur = cur->next)
{
if (cur->this_one_change == STRUCTURAL_CHANGE)