* xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes

that could (at least in theory) be that large.
This commit is contained in:
Paul Eggert 2011-03-22 01:59:50 -07:00
parent b7cbbd6f01
commit 916c72e97a
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2011-03-22 Paul Eggert <eggert@cs.ucla.edu>
* xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
that could (at least in theory) be that large.
* xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
This is less likely to overflow, and avoids undefined behavior if
overflow does occur. All callers changed. Use strtoul to scan

View file

@ -922,7 +922,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p)
#endif
Lisp_Object items;
widget_value *wv, *first_wv, *prev_wv = 0;
int i, last_i = 0;
EMACS_UINT i, last_i = 0;
int *submenu_start, *submenu_end;
int *submenu_top_level_items, *submenu_n_panes;