diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-17 12:35:07 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-17 12:35:07 +0800 |
commit | 01616d0056baf868477b8a0f2d477c8359054e2a (patch) | |
tree | 295e9a1902dc9c8dbfa6503606aa5b78d531e1f0 | |
parent | d567833e31af489f83df64ce6634af8309b1482a (diff) | |
download | pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar.gz pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar.bz2 pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar.lz pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar.xz pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.tar.zst pttbbs-01616d0056baf868477b8a0f2d477c8359054e2a.zip |
fix last commit error
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1058 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/edit.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index 81fc73da..56dc46cf 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.37 2003/07/17 03:27:29 victor Exp $ */ +/* $Id: edit.c,v 1.38 2003/07/17 04:35:07 victor Exp $ */ /* edit.c, 用來提供 bbs上的文字編輯器, 即 ve. * 現在這一個是惡搞過的版本, 比較不穩定, 用比較多的 cpu, 但是可以省下許多 * 的記憶體 (以 Ptt為例, 在九千人上站的時候, 約可省下 50MB 的記憶體) @@ -909,24 +909,25 @@ addsignature(FILE * fp, int ifuseanony) } if (!ifuseanony) { num = showsignature(fpath, &i); - msg[34] = ch = isdigit(cuser.signature) ? cuser.signature : 'X'; - getdata(0, 0, msg, buf, 4, DOECHO); + if (num){ + msg[34] = ch = isdigit(cuser.signature) ? cuser.signature : 'X'; + getdata(0, 0, msg, buf, 4, DOECHO); - if (buf[0] == 0 || buf[0] == 'x' || isdigit(buf[0])) { if (isdigit(buf[0])) ch = buf[0]; else ch = '1' + rand() % num; cuser.signature = buf[0]; - } - if (ch != '0') { - fpath[i] = ch; - if ((fs = fopen(fpath, "r"))) { - fputs("\n--\n", fp); - for (i = 0; i < MAX_SIGLINES && - fgets(buf, sizeof(buf), fs); i++) - fputs(buf, fp); - fclose(fs); + + if (ch != '0') { + fpath[i] = ch; + if ((fs = fopen(fpath, "r"))) { + fputs("\n--\n", fp); + for (i = 0; i < MAX_SIGLINES && + fgets(buf, sizeof(buf), fs); i++) + fputs(buf, fp); + fclose(fs); + } } } } |