summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.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/edit.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/edit.c')
-rw-r--r--mbbsd/edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 354a2abb..f585fab8 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1,4 +1,4 @@
-/* $Id: edit.c,v 1.25 2003/01/16 11:58:04 kcwu Exp $ */
+/* $Id: edit.c,v 1.26 2003/01/19 16:06:06 kcwu Exp $ */
#include "bbs.h"
typedef struct textline_t {
struct textline_t *prev;
@@ -460,10 +460,11 @@ delete_char()
}
static void
-load_file(FILE * fp)
+load_file(FILE * fp) /* NOTE it will fclose(fp) */
{
int indent_mode0 = indent_mode;
+ assert(fp);
indent_mode = 0;
while (fgets(line, WRAPMARGIN + 2, fp))
insert_string(line);
@@ -972,6 +973,7 @@ write_file(char *fpath, int saveheader, int *islocal)
for (p = firstline; p; p = v) {
v = p->next;
if (!aborted) {
+ assert(fp);
msg = p->data;
if (v || msg[0]) {
trim(msg);