summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2018-03-09 14:27:08 +0100
committerSimeon Simeonov2018-03-09 14:27:08 +0100
commit43cd0bb654ae0225388678aa09798fc94be7a135 (patch)
treeba371206f0822163c11f268caa1ee72b55eb7b85
parentf1babd48f5259186cd1233288992f942d4b5b0bb (diff)
Fix some typos and tabify
-rw-r--r--libsylph/masterpassword.c9
-rw-r--r--src/main.c8
2 files changed, 8 insertions, 9 deletions
diff --git a/libsylph/masterpassword.c b/libsylph/masterpassword.c
index 4cef644..d240a7a 100644
--- a/libsylph/masterpassword.c
+++ b/libsylph/masterpassword.c
@@ -140,15 +140,12 @@ gint check_master_password_interactively(guint max_attempts) {
140 140
141 guint cnt; 141 guint cnt;
142 142
143 if (max_attempts < 1) 143 g_return_val_if_fail(max_attempts > 0, 1);
144 return 1; 144 g_return_val_if_fail(prefs_common.master_password_hash != NULL, 1);
145
146 if (prefs_common.master_password_hash != NULL) {
147 return 1;
148 }
149 145
150 if (master_password != NULL) { 146 if (master_password != NULL) {
151 /* password already cached */ 147 /* password already cached */
148 debug_print("Master password already cached\n");
152 return check_password(master_password, 149 return check_password(master_password,
153 prefs_common.master_password_hash); 150 prefs_common.master_password_hash);
154 } 151 }
diff --git a/src/main.c b/src/main.c
index 7c1cd7b..c6bd812 100644
--- a/src/main.c
+++ b/src/main.c
@@ -280,9 +280,9 @@ int main(int argc, char *argv[])
280#if USE_SSL 280#if USE_SSL
281 if (prefs_common.use_master_password) { 281 if (prefs_common.use_master_password) {
282 if (prefs_common.master_password_hash != NULL) { 282 if (prefs_common.master_password_hash != NULL) {
283 if (check_master_password_interactively(3)) { 283 if (check_master_password_interactively(3) != RC_OK) {
284 if (alertpanel(_("Master password"), 284 if (alertpanel(_("Master password"),
285 _("Unable to set master password"), 285 _("Invalid master password"),
286 GTK_STOCK_DISCARD, 286 GTK_STOCK_DISCARD,
287 GTK_STOCK_QUIT, 287 GTK_STOCK_QUIT,
288 NULL) != G_ALERTDEFAULT) { 288 NULL) != G_ALERTDEFAULT) {
@@ -290,7 +290,9 @@ int main(int argc, char *argv[])
290 } 290 }
291 } 291 }
292 } else { 292 } else {
293 if (set_master_password_interactively(3) != 0) { 293 alertpanel_notice(
294 _("Master password enabled but not set. Setting one now"));
295 if (set_master_password_interactively(3) != RC_OK) {
294 if (alertpanel(_("Master password"), 296 if (alertpanel(_("Master password"),
295 _("Unable to set master password"), 297 _("Unable to set master password"),
296 GTK_STOCK_DISCARD, 298 GTK_STOCK_DISCARD,