summaryrefslogtreecommitdiffstats
path: root/mbbsd/xyz.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/xyz.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/xyz.c')
-rw-r--r--mbbsd/xyz.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mbbsd/xyz.c b/mbbsd/xyz.c
index 707ae02e..948a4275 100644
--- a/mbbsd/xyz.c
+++ b/mbbsd/xyz.c
@@ -1,4 +1,4 @@
-/* $Id: xyz.c,v 1.14 2003/01/16 20:22:06 kcwu Exp $ */
+/* $Id: xyz.c,v 1.15 2003/01/19 16:06:06 kcwu Exp $ */
#include "bbs.h"
/* 各種統計及相關資訊列表 */
@@ -211,11 +211,16 @@ note()
if ((foo = fopen(".note", "a")) == NULL)
return 0;
- if ((fp = fopen(fn_note_ans, "w")) == NULL)
+ if ((fp = fopen(fn_note_ans, "w")) == NULL) {
+ fclose(fp);
return 0;
+ }
- if ((fx = open(fn_note_tmp, O_WRONLY | O_CREAT, 0644)) <= 0)
+ if ((fx = open(fn_note_tmp, O_WRONLY | O_CREAT, 0644)) <= 0) {
+ fclose(foo);
+ fclose(fp);
return 0;
+ }
if ((fd = open(fn_note_dat, O_RDONLY)) == -1)
total = 1;
@@ -305,6 +310,7 @@ mail_sysop()
}
}
}
+ fclose(fp);
move(12, 0);
clrtobot();
@@ -463,7 +469,6 @@ x_archie()
if (*ans == 'y') {
fileheader_t mhdr;
char title[128], buf1[80];
- FILE *fp;
sethomepath(buf1, cuser.userid);
stampfile(buf1, &mhdr);