- /* Return the next command help string, before moving the pointer on to\r
- the next command in the list. */\r
- pcReturn = pxCommand->pxCommandLineDefinition->pcHelpString;\r
- pxCommand = pxCommand->pxNext;\r
+ /* Reset the pxCommand pointer back to the start of the list. */\r
+ pxCommand = &xRegisteredCommands;\r
+ }\r
+\r
+ /* Return the next command help string, before moving the pointer on to\r
+ the next command in the list. */\r
+ strncpy( ( char * ) pcWriteBuffer, ( const char * ) pxCommand->pxCommandLineDefinition->pcHelpString, xWriteBufferLen );\r
+ pxCommand = pxCommand->pxNext;\r
+\r
+ if( pxCommand == NULL )\r
+ {\r
+ /* There are no more commands in the list, so there will be no more\r
+ strings to return after this one and pdFALSE should be returned. */\r
+ xReturn = pdFALSE;\r