Browse Source

refactoring: comment a function and rename a variable

remotes/origin/georg
KaffeeMaus 11 months ago
parent
commit
f0164972c9
  1. 7
      src/main/c/Georg/tictactoe.c

7
src/main/c/Georg/tictactoe.c

@ -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;
} }

Loading…
Cancel
Save