summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-10-14 13:03:11 +0800
committerrobertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-10-14 13:03:11 +0800
commitd8601a0affbc594392442da72daf1f51142c209e (patch)
treed1b09b13a9b005c0397d44cfce79659c2a3e1629
parent5e7058be8ef54fe86ea7329bb5362bce792db649 (diff)
downloadpttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar.gz
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar.bz2
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar.lz
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar.xz
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.tar.zst
pttbbs-d8601a0affbc594392442da72daf1f51142c209e.zip
Fix buffer alignment calculation bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5708 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/common/sys/buffer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pttbbs/common/sys/buffer.c b/pttbbs/common/sys/buffer.c
index e1ff417a..fa084b01 100644
--- a/pttbbs/common/sys/buffer.c
+++ b/pttbbs/common/sys/buffer.c
@@ -87,6 +87,7 @@ int buffer_read_from_func(
static int buffer__aligned_size(int desired_size) {
int aligned_size = desired_size / BUFFER_MIN_INCREMENT;
+ aligned_size *= BUFFER_MIN_INCREMENT;
if (aligned_size < desired_size)
aligned_size += BUFFER_MIN_INCREMENT;
return aligned_size;