diff --git a/radio/src/gui/horus/navigation.cpp b/radio/src/gui/horus/navigation.cpp index 1ca43a1a1..f77312e7e 100644 --- a/radio/src/gui/horus/navigation.cpp +++ b/radio/src/gui/horus/navigation.cpp @@ -288,8 +288,6 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags } } popupMenuHandler = onSourceLongEnterPress; - - TRACE("count items apres = %d", popupMenuNoItems); } if (checkIncDecSelection != 0) { newval = checkIncDecSelection; @@ -327,7 +325,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags } #define CURSOR_NOT_ALLOWED_IN_ROW(row) ((int8_t)MAXCOL(row) < 0) -#define MAXCOL_RAW(row) (horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) +#define MAXCOL_RAW(row) ((row) >= 0 && horTab ? pgm_read_byte(horTab+min(row, (vertpos_t)horTabMax)) : (const uint8_t)0) #define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE))) #define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE)) #define INC(val, min, max) if (val