Code

screen_utils: hide cursor after screen_read_password()
authorMax Kellermann <max@duempel.org>
Mon, 22 Sep 2008 08:39:01 +0000 (10:39 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 22 Sep 2008 08:39:01 +0000 (10:39 +0200)
The call to curs_set(0) in screen_read_password() was dead code,
because it was after the function return.  Repair that.

src/screen_utils.c

index c6bfb543c8d7b6bdc1cc6517e1a365e265cfb7b0..5e534a12e6f94a4738da3986a20588780a97c265 100644 (file)
@@ -100,6 +100,8 @@ screen_getstr(WINDOW *w, const char *prompt)
 static char *
 screen_read_password(WINDOW *w, const char *prompt)
 {
+       char *ret;
+
        if (w == NULL) {
                int rows, cols;
                getmaxyx(stdscr, rows, cols);
@@ -114,11 +116,12 @@ screen_read_password(WINDOW *w, const char *prompt)
        colors_use(w, COLOR_STATUS_ALERT);
 
        if (prompt == NULL)
-               return wreadln_masked(w, _("Password: "), NULL, COLS, NULL, NULL);
+               ret = wreadln_masked(w, _("Password: "), NULL, COLS, NULL, NULL);
        else
-               return wreadln_masked(w, prompt, NULL, COLS, NULL, NULL);
+               ret = wreadln_masked(w, prompt, NULL, COLS, NULL, NULL);
 
        curs_set(0);
+       return ret;
 }
 
 static gint