diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-16 02:13:35 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-16 02:13:35 +0800 |
commit | 80bf33613f2aaa890a85da4ec6980ab2194f36e1 (patch) | |
tree | a879a114e0654e43cb1793312ad3442a854ff8bd /mbbsd | |
parent | 9597a8bd383d61033dbfa0ac3753b4ed1b1c0b73 (diff) | |
download | pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar.gz pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar.bz2 pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar.lz pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar.xz pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.tar.zst pttbbs-80bf33613f2aaa890a85da4ec6980ab2194f36e1.zip |
fix bug for r2580
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2629 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 30 | ||||
-rw-r--r-- | mbbsd/user.c | 10 |
2 files changed, 22 insertions, 18 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 6251d239..7d024957 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -1087,18 +1087,24 @@ scan_register_form(char *regfile, int automode, int neednum) outs("也就是大概二十分之一的數量,當然,您也可以多審\n沒審完之前,系統不會讓你跳出喲!謝謝"); pressanykey(); } - memset(fdata, 0, sizeof(fdata)); - while (fgets(genbuf, STRLEN, fn)) { - if ((ptr = (char *)strstr(genbuf, ": "))) { - *ptr = '\0'; - for (n = 0; field[n]; n++) { - if (strcmp(genbuf, field[n]) == 0) { - strlcpy(fdata[n], ptr + 2, sizeof(fdata[n])); - if ((ptr = (char *)strchr(fdata[n], '\n'))) - *ptr = '\0'; + while( fgets(genbuf, STRLEN, fn) ){ + memset(fdata, 0, sizeof(fdata)); + do { + if( genbuf[0] == '-' ) + break; + if ((ptr = (char *)strstr(genbuf, ": "))) { + *ptr = '\0'; + for (n = 0; field[n]; n++) { + if (strcmp(genbuf, field[n]) == 0) { + strlcpy(fdata[n], ptr + 2, sizeof(fdata[n])); + if ((ptr = (char *)strchr(fdata[n], '\n'))) + *ptr = '\0'; + } } } - } else if ((unum = getuser(fdata[0], &muser)) == 0) { + } while( fgets(genbuf, STRLEN, fn) ); + + if ((unum = getuser(fdata[0], &muser)) == 0) { move(2, 0); clrtobot(); outs("系統錯誤,查無此人\n\n"); @@ -1120,9 +1126,9 @@ scan_register_form(char *regfile, int automode, int neednum) move(14, 0); prints("\033[1;32m------------- 請站長嚴格審核使用者資料,您還有 %d 份---------------\033[m\n", neednum); prints(" %-12s:%s\n", finfo[0], fdata[0]); - prints(" %-12s:%s\n", finfo[1], fdata[1]); #ifdef FOREIGN_REG - prints("0.%-12s:%s%s\n", finfo[2], fdata[2], muser.uflag2 & FOREIGN ? " (外籍)" : ""); + prints("0.%-12s:%s%s\n", finfo[2], fdata[2], + muser.uflag2 & FOREIGN ? " (外籍)" : ""); #else prints("0.%-12s:%s\n", finfo[2], fdata[2]); #endif diff --git a/mbbsd/user.c b/mbbsd/user.c index 2559bdc3..9327dd59 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -1029,8 +1029,8 @@ toregister(char *email, char *genbuf, char *phone, char *career, if (phone[0] != 0) { fn = fopen(buf, "w"); assert(fn); - fprintf(fn, "%s\n%s\n%s\n%s\n%s\n%s\n", - phone, career, ident, rname, addr, mobile); + fprintf(fn, "%s\n%s\ndummy\n%s\n%s\n%s\n", + phone, career, rname, addr, mobile); fclose(fn); } clear(); @@ -1098,7 +1098,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, if ((fn = fopen(fn_register, "a"))) { fprintf(fn, "num: %d, %s", usernum, ctime4(&now)); fprintf(fn, "uid: %s\n", cuser.userid); - fprintf(fn, "ident: %s\n", ident); + fprintf(fn, "ident: \n"); fprintf(fn, "name: %s\n", rname); fprintf(fn, "career: %s\n", career); fprintf(fn, "addr: %s\n", addr); @@ -1304,9 +1304,7 @@ u_register(void) chomp(genbuf); strlcpy(career, genbuf, sizeof(career)); - fgets(genbuf, sizeof(genbuf), fn); - chomp(genbuf); - strlcpy(ident, genbuf, sizeof(ident)); + fgets(genbuf, sizeof(genbuf), fn); // old version compatible fgets(genbuf, sizeof(genbuf), fn); chomp(genbuf); |