From ee60d9a289f8d94f8e4d8405f7b41690b891bbb1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 12 Nov 1998 07:32:33 +0000 Subject: [PATCH] handle null usernames --- source/web/swat.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/source/web/swat.c b/source/web/swat.c index f5c8e286cdc..a1e56e9389f 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -661,7 +661,7 @@ static void chg_passwd(void) ****************************************************************************/ static void passwd_page(void) { - char *new_name; + char *new_name = get_user_name(); printf("

Password Manager

\n"); @@ -673,14 +673,11 @@ static void passwd_page(void) * After the first time through here be nice. If the user * changed the User box text to another users name, remember it. */ - if (cgi_variable(USER) && - (strcmp(cgi_variable(USER), get_user_name()))) { - /* User is changing another accounts passwd */ + if (cgi_variable(USER)) { new_name = cgi_variable(USER); - } else { - /* User is changing there own passwd */ - new_name = get_user_name(); - } + } + + if (!new_name) new_name = ""; printf("

User Name : \n", USER, new_name); -- 2.34.1