summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-27 21:50:57 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-27 21:50:57 +0800
commit7007588c72ec22498b1bca5a0502af7ddc0ea35f (patch)
tree886a91789ef45e836bfe19a7587fbf7d3abb59b1 /mbbsd
parente1fce65ed8fed7029b853401c3aa207ac5a6f2bd (diff)
downloadpttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar.gz
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar.bz2
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar.lz
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar.xz
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.tar.zst
pttbbs-7007588c72ec22498b1bca5a0502af7ddc0ea35f.zip
1.only sysop can edit database directly
2.fix crash because of missing database git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@448 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/indict.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/indict.c b/mbbsd/indict.c
index fe7da8c4..14650fea 100644
--- a/mbbsd/indict.c
+++ b/mbbsd/indict.c
@@ -1,4 +1,4 @@
-/* $Id: indict.c,v 1.9 2002/07/27 10:04:59 kcwu Exp $ */
+/* $Id: indict.c,v 1.10 2002/07/27 13:50:57 kcwu Exp $ */
#include "bbs.h"
#define REFER "etc/dicts"
@@ -128,7 +128,7 @@ use_dict()
more("etc/dict.hlp", YEA);
clear();
continue;
- } else if (word[0] == 'e') {
+ } else if (word[0] == 'e' && HAS_PERM(PERM_SYSOP)) {
vedit(database, NA, NULL);
clear();
continue;
@@ -137,9 +137,9 @@ use_dict()
continue;
}
}
+ i = 0;
if ((fp = fopen(database, "r"))) {
- i = 0;
- while (fgets(lang, 150, fp) != NULL) {
+ while (fgets(lang, sizeof(lang), fp) != NULL) {
if (lang[65] == '[') {
lang[65] = 0;
f = 1;
@@ -166,8 +166,8 @@ use_dict()
}
}
}
+ fclose(fp);
}
- fclose(fp);
if (i == 0) {
getdata(5, 0, "沒這個資料耶,新增嗎?(y/N)", lang, 3, LCECHO);
if (lang[0] == 'y') {