summaryrefslogtreecommitdiffstats
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
commitea996d22d24ac8c12f1daf21d86b71881cfb6d6b (patch)
tree13fb8a7cbb2fb1232631a0911af61a4419fcecc1
parenta76fd95c065aad3f13f9c274be95975a7bc8c4fa (diff)
downloadpttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar.gz
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar.bz2
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar.lz
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar.xz
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.tar.zst
pttbbs-ea996d22d24ac8c12f1daf21d86b71881cfb6d6b.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@448 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/indict.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/indict.c b/pttbbs/mbbsd/indict.c
index fe7da8c4..14650fea 100644
--- a/pttbbs/mbbsd/indict.c
+++ b/pttbbs/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') {