diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-19 20:13:38 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-09-19 20:13:38 +0800 |
commit | 2b40d1a7281cb674ca84c601b6b61c4580606bd4 (patch) | |
tree | 54a27a13fe0af8aa2d179a0d9875142ede5482bb /mbbsd/edit.c | |
parent | e7c32a2badb06e041eb4528e521c6271fa9b1f13 (diff) | |
download | pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar.gz pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar.bz2 pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar.lz pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar.xz pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.tar.zst pttbbs-2b40d1a7281cb674ca84c601b6b61c4580606bd4.zip |
Skip nonexistent signature files when "random signature" is chosen.
by mhsin
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3192 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index af58f2ea..45cfe76d 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -1524,13 +1524,12 @@ browse_sigs: if (!buf[0]) buf[0] = ch; - if (isdigit((int)buf[0])) - ch = buf[0]; - else - ch = '1' + random() % (si.max+1); + ch = buf[0]; cuser.signature = buf[0]; - if (ch != '0') { + while (ch != '0' && si.total > 0) { + if(!isdigit((int)buf[0])) + ch = '1' + random() % (si.max+1); fpath[i] = ch; if ((fs = fopen(fpath, "r"))) { fputs("\n--\n", fp); @@ -1538,6 +1537,7 @@ browse_sigs: fgets(buf, sizeof(buf), fs); i++) fputs(buf, fp); fclose(fs); + ch = '0'; } } } |