summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index a85949a..229c606 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);