]> granicus.if.org Git - nethack/commitdiff
curses: fix unused label 'bail'
authorPatR <rankin@nethack.org>
Fri, 8 Jan 2021 21:57:52 +0000 (13:57 -0800)
committerPatR <rankin@nethack.org>
Fri, 8 Jan 2021 21:57:52 +0000 (13:57 -0800)
when SELECTSAVED isn't defined by using a goto for it even when
an 'if' was easily avoiding the need for that.

win/curses/cursmain.c

index 5607897ba13feebcac698302688e5488a51b5dd3..7d8d4ac118f6c339066300d591defcb9e48d13b3 100644 (file)
@@ -254,10 +254,11 @@ curses_askname()
 
     curses_line_input_dialog("Who are you?", g.plname, PL_NSIZ);
     (void) mungspaces(g.plname);
-    if (g.plname[0] && g.plname[0] != '\033') {
-         iflags.renameallowed = TRUE; /* tty uses this, we don't [yet?] */
-         return;
-    }
+    if (!g.plname[0] || g.plname[0] == '\033')
+         goto bail;
+
+    iflags.renameallowed = TRUE; /* tty uses this, we don't [yet?] */
+    return;
 
  bail:
     /* message is delivered via raw_print() */