From 29a0dc6ce18c15adf65f7cb51e54321e79a9d0a7 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sat, 13 Jul 1996 18:51:11 +0000 Subject: [PATCH] (xm_update_menu): Fix loop termination test. --- lwlib/lwlib-Xm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.2