diff --git a/Exercise 3/Lexer.c b/Exercise 3/Lexer.c index 12993d4..eb341d1 100644 --- a/Exercise 3/Lexer.c +++ b/Exercise 3/Lexer.c @@ -1,10 +1,12 @@ #include "Lexer.h" int start(char* src) { - if (src != 0 && src != '\0') { // checking if the string is empty or invalid - return _GET_NEXT_CHARACTER_; + if (src != 0) { // checking if the string is invalid + if (*src != '\0') { // checking if the string is empty + return _GET_NEXT_CHARACTER_; // if src is valid: continueing the state machine + } } - return _STOP_; + return _STOP_; // stopping the state machine in any other case } int getNextCharacter(char* src) {