summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-10-18 09:16:55 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-10-18 09:16:55 +0000
commitcf296e05655e1282cbf5a9bc5bfdfd2f4480e662 (patch)
tree8ecb31fd963564fbc8b72c5267219f5357177977 /src
parent57067a923d7f85f847cf3c0aab081f86745f585f (diff)
STR #unfiled: when using Fl_Menu_::add, the 'flags' field of the last entry in a newly allocated local buffer would not be cleared. If the flag happened to be FL_SUBMENU, this would lead to crash in 'find_item'. The new code clears the entire field.
And yes, this has cost me a few hours :-P git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Menu_add.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Fl_Menu_add.cxx b/src/Fl_Menu_add.cxx
index f51b5f381..77a70edd8 100644
--- a/src/Fl_Menu_add.cxx
+++ b/src/Fl_Menu_add.cxx
@@ -204,7 +204,7 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
local_array = menu_ = new Fl_Menu_Item[local_array_alloc];
memset(local_array, 0, sizeof(Fl_Menu_Item) * local_array_alloc);
}
- menu_[0].text = 0;
+ memset(menu_, 0, sizeof(Fl_Menu_Item));
local_array_size = 1;
}
fl_menu_array_owner = this;