|
@ -59,6 +59,11 @@ void trimRight(char *input) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void trim(char *input) { |
|
|
|
|
|
trimLeft(input); |
|
|
|
|
|
trimRight(input); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
char *readInput() { |
|
|
char *readInput() { |
|
|
if (fakeInput != NULL) { |
|
|
if (fakeInput != NULL) { |
|
|
if (fakeInput[0] == NULL) { |
|
|
if (fakeInput[0] == NULL) { |
|
@ -88,8 +93,7 @@ char *readInput() { |
|
|
} |
|
|
} |
|
|
while(c != '\n' && c != EOF); |
|
|
while(c != '\n' && c != EOF); |
|
|
buffer[index - 1] = '\0'; |
|
|
buffer[index - 1] = '\0'; |
|
|
trimLeft(buffer); |
|
|
|
|
|
trimRight(buffer); |
|
|
|
|
|
|
|
|
trim(buffer); |
|
|
return buffer; |
|
|
return buffer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|