summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-01-20 00:06:06 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-01-20 00:06:06 +0800
commit795d7da28a8514e8315643820badb86919da2e2e (patch)
tree1911b4e7e874dd5999ea49ac5767ca720c7ac2e9 /mbbsd/user.c
parent26382c16358fd5e6746a7a4d00210248b0c255c5 (diff)
downloadpttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar.gz
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar.bz2
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar.lz
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar.xz
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.tar.zst
pttbbs-795d7da28a8514e8315643820badb86919da2e2e.zip
* there are so many fopen() without fclose()
* assert fopen() * clean up git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@638 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r--mbbsd/user.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index e3bb1f89..c236279a 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -1,4 +1,4 @@
-/* $Id: user.c,v 1.44 2002/12/31 17:40:52 in2 Exp $ */
+/* $Id: user.c,v 1.45 2003/01/19 16:06:06 kcwu Exp $ */
#include "bbs.h"
static char *sex[8] = {
@@ -568,6 +568,7 @@ u_switchproverb()
setuserfile(buf, fn_proverb);
if (cuser.proverb == 2 && dashd(buf)) {
FILE *fp = fopen(buf, "a");
+ assert(fp);
fprintf(fp, "座右銘狀態為[自定型]要記得設座右銘的內容唷!!");
fclose(fp);
@@ -620,7 +621,9 @@ showsignature(char *fname)
fname[j] = ch;
if ((fp = fopen(fname, "r"))) {
prints("\033[36m【 簽名檔.%c 】\033[m\n", ch);
- for (i = 0; i++ < MAX_SIGLINES && fgets(buf, 256, fp); outs(buf));
+ for (i = 0; i < MAX_SIGLINES && fgets(buf, sizeof(buf), fp); i++)
+ outs(buf);
+
fclose(fp);
}
}
@@ -826,6 +829,7 @@ toregister(char *email, char *genbuf, char *phone, char *career,
sethomefile(buf, cuser.userid, "justify.wait");
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);
fclose(fn);