From ab399b12fa4f879ca616c36456da6611b11fdd67 Mon Sep 17 00:00:00 2001 From: SinusFox Date: Mon, 15 May 2023 15:08:14 +0200 Subject: [PATCH] update --- Exercise 3/Lexer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) {