Module Name:    src
Committed By:   snj
Date:           Tue Jan 20 21:51:05 UTC 2015

Modified Files:
        src/usr.sbin/sysinst: configmenu.c

Log Message:
Handle empty input gracefully by simply jumping back to the config menu.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/configmenu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.2 src/usr.sbin/sysinst/configmenu.c:1.3
--- src/usr.sbin/sysinst/configmenu.c:1.2	Sun Aug  3 16:09:38 2014
+++ src/usr.sbin/sysinst/configmenu.c	Tue Jan 20 21:51:05 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: configmenu.c,v 1.3 2015/01/20 21:51:05 snj Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -252,10 +252,12 @@ check_root_password(void)
 static int
 add_new_user(struct menudesc *menu, void *arg)
 {
-	char username[STRSIZE];
+	char username[STRSIZE] = "";
 	int inwheel=0;
 
 	msg_prompt(MSG_addusername, NULL, username, sizeof username -1);
+	if (strlen(username) == 0)
+		return 0;
 	process_menu(MENU_yesno, deconst(MSG_addusertowheel));
 	inwheel = yesno;
 	ushell = "/bin/csh";

Reply via email to