summaryrefslogtreecommitdiffstats
path: root/mbbsd/read.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-30 13:59:36 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-30 13:59:36 +0800
commitcd29a1da3cbeec80559309f8e16bba071137f2f8 (patch)
tree00f5c657e0d119515a5c46f0b56c4b169307d573 /mbbsd/read.c
parent25ab88da2f3b6244c861c859999f658fc4c2990e (diff)
downloadpttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar.gz
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar.bz2
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar.lz
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar.xz
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.tar.zst
pttbbs-cd29a1da3cbeec80559309f8e16bba071137f2f8.zip
- board: enable changing to MyFavorite in HotBoards
- bugfix: snprintf() on UNIX takes directly sizeof(buf) and always append NUL. Warning: Windows port will not output NUL if truncated. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3883 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r--mbbsd/read.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 52f010ee..66ea613f 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -1177,8 +1177,7 @@ get_records_and_bottom(char *direct, fileheader_t* headers,
if (n > 0) {
char directbottom[PATHLEN];
- snprintf(directbottom, sizeof(directbottom)-1, "%s.bottom", direct);
- directbottom[sizeof(directbottom)-1] = 0;
+ snprintf(directbottom, sizeof(directbottom), "%s.bottom", direct);
n = get_records(directbottom, headers+rv, sizeof(fileheader_t), 1, n);
if (n < 0) n = 0;
rv += n;