\r
}\r
\r
+int roundUp(int numToRound, int multiple) {\r
+ if(multiple == 0) {\r
+ return numToRound;\r
+ }\r
+\r
+ int remainder = numToRound % multiple;\r
+ if (remainder == 0)\r
+ return numToRound;\r
+ return numToRound + multiple - remainder;\r
+}\r
+\r
int makeSubmenuFromArray( const char *menuEntries[], unsigned int menuEntriesSize, void *callback ) {\r
if ( menuEntriesSize == 0 ) return -1;\r
\r
- int menuNumber = menuEntriesSize / 10 + 1;\r
+ int menuNumber = roundUp(menuEntriesSize, 10) / 10;\r
int submenuObjects[menuNumber-1];\r
\r
for( int i = 0; i < menuNumber; i++ ) {\r