summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/passwd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index 4fb04652..ec4e68ec 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -126,8 +126,13 @@ userec_t userecbuf;
int initcuser(char *userid)
{
// Ptt: setup cuser and usernum here
- if(userid[0]=='\0') return -1;
- if(!(usernum = searchuser(userid)) || usernum > MAX_USERS) return -1;
+ if(userid[0]=='\0' ||
+ !(usernum = searchuser(userid)) || usernum > MAX_USERS)
+ {
+ memset(&userecbuf, 0, sizeof(userecbuf));
+ strcpy(userecbuf.userid, STR_GUEST);
+ return -1;
+ }
passwd_query(usernum, &userecbuf);
cuser = &userecbuf;
return usernum;