|
@ -80,11 +80,10 @@ char* getUserInput(){ |
|
|
printf( ":" ); |
|
|
printf( ":" ); |
|
|
fgets(userInput, sizeof(userInput), stdin); |
|
|
fgets(userInput, sizeof(userInput), stdin); |
|
|
|
|
|
|
|
|
size_t len = strlen(userInput); |
|
|
|
|
|
if (len > 0 && userInput[len - 1] == '\n') { |
|
|
|
|
|
userInput[len - 1] = '\0'; |
|
|
|
|
|
|
|
|
size_t lengthOfInput = strlen(userInput); |
|
|
|
|
|
if (lengthOfInput > 0 && userInput[lengthOfInput - 1] == '\n') { |
|
|
|
|
|
userInput[lengthOfInput - 1] = '\0'; // declare end of command |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return userInput; |
|
|
return userInput; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|