summaryrefslogtreecommitdiffstats
path: root/mbbsd/friend.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-07 03:52:57 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-07 03:52:57 +0800
commitfc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b (patch)
treef3f43d69f0b65589a931b98a634e3b27d2c5d136 /mbbsd/friend.c
parentbc3952ec2fcbddd3c4820f21c8490ccd8c728a1d (diff)
downloadpttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar.gz
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar.bz2
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar.lz
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar.xz
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.tar.zst
pttbbs-fc05c7ec6b8d7bbd2fbad6426c2e5d23994aea0b.zip
clean up
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1166 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/friend.c')
-rw-r--r--mbbsd/friend.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index 16e36c63..3f97ee71 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -152,18 +152,14 @@ friend_append(int type, int count)
for (j = i = 0; i <= 4; i++)
if (i != type) {
++j;
- snprintf(buf, sizeof(buf),
- " (%d) %-s\n", j, friend_list[(int)i]);
- outs(buf);
+ prints(" (%d) %-s\n", j, friend_list[(int)i]);
}
if (HAVE_PERM(PERM_SYSOP) || currmode & MODE_BOARD)
for (; i < 8; ++i)
if (i != type) {
++j;
- snprintf(buf, sizeof(buf),
- " (%d) %s 板的 %s\n", j, currboard,
+ prints(" (%d) %s 板的 %s\n", j, currboard,
friend_list[(int)i]);
- outs(buf);
}
outs(" (S) 選擇其他看板的特別名單");
getdata(11, 0, "請選擇 或 直接[Enter] 放棄:", buf, 3, LCECHO);
@@ -187,7 +183,7 @@ friend_append(int type, int count)
while (fgets(buf, 80, fp) && (unsigned)count <= friend_max[type]) {
char the_id[15];
- sscanf(buf, "%s", the_id);
+ sscanf(buf, "%s", the_id); // XXX check buffer size
if (!belong(fpath, the_id)) {
if ((fp1 = fopen(fpath, "a"))) {
flock(fileno(fp1), LOCK_EX);
@@ -311,7 +307,7 @@ friend_water(char *message, int type)
userinfo_t *uentp;
int tuid;
- sscanf(line, "%s", userid);
+ sscanf(line, "%s", userid); // XXX check buffer size
if ((tuid = searchuser(userid)) && tuid != usernum &&
(uentp = (userinfo_t *) search_ulist(tuid)) &&
isvisible_uid(tuid))
@@ -344,8 +340,7 @@ friend_edit(int type)
while (1) {
stand_title(friend_list[type]);
move(0, 40);
- snprintf(line, sizeof(line), "(名單上限:%d個人)", friend_max[type]);
- outs(line);
+ prints("(名單上限:%d個人)", friend_max[type]);
count = 0;
CreateNameList();
@@ -421,7 +416,7 @@ friend_edit(int type)
snprintf(genbuf, sizeof(genbuf), "%s.old", fpath);
if ((fp = fopen(genbuf, "r"))) {
while (fgets(line, 80, fp)) {
- sscanf(line, "%s", uident);
+ sscanf(line, "%s", uident); // XXX check buffer size
sethomefile(genbuf, uident,
type == FRIEND_ALOHA ? "aloha" : "postnotify");
del_distinct(genbuf, cuser.userid);
@@ -431,7 +426,7 @@ friend_edit(int type)
snprintf(genbuf, sizeof(genbuf), "%s", fpath);
if ((fp = fopen(genbuf, "r"))) {
while (fgets(line, 80, fp)) {
- sscanf(line, "%s", uident);
+ sscanf(line, "%s", uident); // XXX check buffer size
sethomefile(genbuf, uident,
type == FRIEND_ALOHA ? "aloha" : "postnotify");
add_distinct(genbuf, cuser.userid);