diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-05 02:23:33 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-12-05 02:23:33 +0800 |
commit | 96306001d500d09be6137a22c02f1888936c1adc (patch) | |
tree | 6d51d9727cf093d4b4d3f8fb76ee14fffdb09f59 /mbbsd | |
parent | 6e592b3fbc459867f9966c3cdefbc363a26ec895 (diff) | |
download | pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar.gz pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar.bz2 pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar.lz pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar.xz pttbbs-96306001d500d09be6137a22c02f1888936c1adc.tar.zst pttbbs-96306001d500d09be6137a22c02f1888936c1adc.zip |
- fixed N in userlist forgetting to initialize user nickname.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3631 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/talk.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 32d22a96..b666227a 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2940,10 +2940,20 @@ userlist(void) case 'N': if (HasUserPerm(PERM_LOGINOK)) { char tmp_nick[sizeof(cuser.nickname)]; - oldgetdata(1, 0, "·sªº¼ÊºÙ: ", - tmp_nick, sizeof(tmp_nick), DOECHO); - strlcpy(cuser.nickname, tmp_nick, sizeof(cuser.nickname)); - strcpy(currutmp->nickname, cuser.nickname); + // XXX why do so many copy here? + // why not just use cuser.nickname? + // XXX old code forget to initialize. + // will changing to init everytime cause user + // complain? + + strlcpy(tmp_nick, currutmp->nickname, sizeof(cuser.nickname)); + + if (oldgetdata(1, 0, "·sªº¼ÊºÙ: ", + tmp_nick, sizeof(tmp_nick), DOECHO) > 0) + { + strlcpy(cuser.nickname, tmp_nick, sizeof(cuser.nickname)); + strcpy(currutmp->nickname, cuser.nickname); + } redrawall = redraw = 1; } break; |