summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-28 16:47:45 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-06-28 16:47:45 +0800
commit2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91 (patch)
tree87e9a623c3a4426e104f87511e2b66f86f75a829 /mbbsd/bbs.c
parentc5f8b96c358e673945943d92c4ba562eba1f96ec (diff)
downloadpttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar.gz
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar.bz2
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar.lz
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar.xz
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.tar.zst
pttbbs-2dea9dc6eeee3dcd9a0ebc32dcee9723c4787c91.zip
assert() the return value of strchr() strrchr()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@982 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 00343018..b89cbbef 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -1,4 +1,4 @@
-/* $Id: bbs.c,v 1.100 2003/06/27 02:39:26 in2 Exp $ */
+/* $Id: bbs.c,v 1.101 2003/06/28 08:47:45 kcwu Exp $ */
#include "bbs.h"
static int recommend(int ent, fileheader_t * fhdr, char *direct);
@@ -1846,7 +1846,9 @@ good_post(int ent, fileheader_t * fhdr, char *direct)
memcpy(&digest, fhdr, sizeof(digest));
digest.filename[0] = 'G';
strlcpy(buf, direct, sizeof(buf));
- ptr = strrchr(buf, '/') + 1;
+ ptr = strrchr(buf, '/');
+ assert(ptr);
+ ptr++;
ptr[0] = '\0';
snprintf(genbuf, sizeof(genbuf), "%s%s", buf, digest.filename);