@@ -37,7 +37,7 @@ void cli::run() {
3737 }
3838}
3939
40- uint32_t cli::countArguments (char * commandLine) {
40+ uint32_t cli::countArguments (const char * commandLine) {
4141 uint32_t count{0 };
4242 uint32_t commandLineLength{0 };
4343 commandLineLength = strnlen (commandLine, maxCommandLineLength);
@@ -52,7 +52,7 @@ uint32_t cli::countArguments(char* commandLine) {
5252 return count;
5353}
5454
55- int32_t cli::getSeparatorPosition (char * commandLine, uint32_t separatorIndex) {
55+ int32_t cli::getSeparatorPosition (const char * commandLine, const uint32_t separatorIndex) {
5656 uint32_t slashCount{0 };
5757 uint32_t dataLength = strnlen (commandLine, maxCommandLineLength);
5858 for (uint32_t position = 0 ; position < dataLength; position++) {
@@ -66,7 +66,7 @@ int32_t cli::getSeparatorPosition(char* commandLine, uint32_t separatorIndex) {
6666 return -1 ;
6767}
6868
69- void cli::getSegment (char * destination, char * commandLine, uint32_t segmentIndex) {
69+ void cli::getSegment (char * destination, const char * commandLine, const uint32_t segmentIndex) {
7070 uint32_t startIndex;
7171 uint32_t endIndex;
7272 uint32_t nmbrOfArguments = countArguments (commandLine);
@@ -94,7 +94,7 @@ void cli::getSegment(char* destination, char* commandLine, uint32_t segmentIndex
9494 destination[endIndex - startIndex] = ' \0 ' ;
9595}
9696
97- void cli::splitCommandLine (char * commandLine) {
97+ void cli::splitCommandLine (const char * commandLine) {
9898 nmbrOfArguments = countArguments (commandLine);
9999 getSegment (command, commandLine, 0 );
100100 for (uint32_t argumentIndex = 0 ; argumentIndex < cliCommand::maxNmbrOfArguments; argumentIndex++) {
@@ -118,7 +118,7 @@ int32_t cli::findCommandIndex() {
118118 return -1 ;
119119}
120120
121- void cli::executeCommand (char * commandLine) {
121+ void cli::executeCommand (const char * commandLine) {
122122 splitCommandLine (commandLine);
123123 int32_t commandIndex = findCommandIndex ();
124124 if (commandIndex >= 0 ) {
0 commit comments