diff options
-rw-r--r-- | src/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -86,7 +86,9 @@ static bool BarMainGetLoginCredentials (BarSettings_t *settings, char nameBuf[100]; BarUiMsg (settings, MSG_QUESTION, "Email: "); - BarReadlineStr (nameBuf, sizeof (nameBuf), input, BAR_RL_DEFAULT); + if (BarReadlineStr (nameBuf, sizeof (nameBuf), input, BAR_RL_DEFAULT) == 0) { + return false; + } settings->username = strdup (nameBuf); usernameFromConfig = false; } @@ -100,7 +102,10 @@ static bool BarMainGetLoginCredentials (BarSettings_t *settings, if (settings->passwordCmd == NULL) { BarUiMsg (settings, MSG_QUESTION, "Password: "); - BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO); + if (BarReadlineStr (passBuf, sizeof (passBuf), input, BAR_RL_NOECHO) == 0) { + puts (""); + return false; + } /* write missing newline */ puts (""); settings->password = strdup (passBuf); |