Fixed a buffer overflow.

This commit is contained in:
2021-09-03 07:59:36 -07:00
parent 1938d44667
commit 282be95493
12 changed files with 104 additions and 103 deletions

View File

@ -18,12 +18,19 @@
/** Maximum number of items that the list supports */
#define MENULIST_ITEMS_MAX 32
typedef struct _menulist_t menulist_t;
/** Callback for when a menulist item is selected */
typedef void menulistcallback_t(menulist_t *list, uint8_t i, void *user);
/** Representation of a menu list, a menu with multiple menu items. */
typedef struct {
typedef struct _menulist_t {
float x, y;
char *items[MENULIST_ITEMS_MAX];
label_t labels[MENULIST_ITEMS_MAX];
frame_t frame;
menu_t menu;
rectangle_t selection;
menulistcallback_t *onSelect;
void *user;
} menulist_t;