Skip to content

Commit cb54429

Browse files
committed
Help command indexing fixed.
1 parent 7f8a365 commit cb54429

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Commander-API.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void Commander::printHelp( Stream* out, bool description, bool style ){
448448
out -> println( __CONST_TXT__( "---- Available commands ----\r\n" ) );
449449
}
450450

451-
for( i = 0; i < regularCommands.getSize(); i++ ){
451+
for( i = 1; i <= regularCommands.getSize(); i++ ){
452452

453453
if( style ){
454454
out -> print( __CONST_TXT__( "\033[1;32m" ) );
@@ -470,6 +470,7 @@ void Commander::printHelp( Stream* out, bool description, bool style ){
470470

471471
// If description is not requested, we can skip the rest of this for loop.
472472
if( !description ){
473+
out -> println();
473474
continue;
474475
}
475476

src/Commander-Database.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ uint16_t CommanderDatabase< T >::findIndexByPlace( uint16_t place ){
248248
uint16_t i;
249249

250250
// Go through all commands
251-
for( i = 1; i <= dataTreeSize; i++ ){
251+
for( i = 0; i < dataTreeSize; i++ ){
252252

253253
// Check that if we found the desired command
254254
if( dataTree[ i ].place == place ){

0 commit comments

Comments
 (0)