fix: switched mode toggles to require exact d/e commands
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -124,7 +124,7 @@ void decode_mode() {
|
||||
if (input.empty())
|
||||
continue;
|
||||
|
||||
if (tolower(input[0]) == 'e')
|
||||
if (input.size() == 1 && (input[0] == 'e' || input[0] == 'E'))
|
||||
return;
|
||||
|
||||
string decoded_message;
|
||||
@@ -176,7 +176,7 @@ void encode_mode() {
|
||||
if (input.empty())
|
||||
continue;
|
||||
|
||||
if (tolower(input[0]) == 'd')
|
||||
if (input.size() == 1 && (input[0] == 'd' || input[0] == 'D'))
|
||||
return;
|
||||
|
||||
cout << "\n";
|
||||
|
||||
Reference in New Issue
Block a user