Valgrind complained in some menus

This commit is contained in:
bsongis
2015-07-07 19:33:33 +02:00
parent bbc43a908e
commit a3df4120e1
+3 -3
View File
@@ -545,7 +545,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
if (horTab) { if (horTab) {
linesCount = 0; linesCount = 0;
for (int i=0; i<rowcount; i++) { for (int i=0; i<rowcount; i++) {
if (horTab[i] != HIDDEN_ROW) { if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
linesCount++; linesCount++;
} }
} }
@@ -566,7 +566,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
else { else {
vertpos_t lastLine = firstLine; vertpos_t lastLine = firstLine;
for (int numLines=0; lastLine<rowcount && numLines<NUM_BODY_LINES; lastLine++) { for (int numLines=0; lastLine<rowcount && numLines<NUM_BODY_LINES; lastLine++) {
if (horTab[lastLine] != HIDDEN_ROW) { if (lastLine>=horTabMax || horTab[lastLine] != HIDDEN_ROW) {
numLines++; numLines++;
} }
} }
@@ -576,7 +576,7 @@ void check(const char *name, check_event_t event, uint8_t curr, const MenuFuncP
else { else {
linesCount = s_pgOfs + NUM_BODY_LINES; linesCount = s_pgOfs + NUM_BODY_LINES;
for (int i=lastLine; i<rowcount; i++) { for (int i=lastLine; i<rowcount; i++) {
if (horTab[i] != HIDDEN_ROW) { if (i>=horTabMax || horTab[i] != HIDDEN_ROW) {
linesCount++; linesCount++;
} }
} }