diff --git a/input_resolver.cpp b/input_resolver.cpp index b95e481..05282da 100644 --- a/input_resolver.cpp +++ b/input_resolver.cpp @@ -71,7 +71,7 @@ Command resolveCommand() bool shouldQuit = token.find("q") != token.npos; bool shouldPrint = token.find("p") != token.npos; - char operation; + char operation = 0; for (const char c: token) { @@ -80,10 +80,11 @@ Command resolveCommand() { operation = c; } - else - { - operation = '+'; - } + } + + if (operation == 0) + { + operation = '+'; } return {shouldQuit, operation, validation_result.next_arg(), shouldPrint};