summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-16 19:16:41 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-06-16 19:16:41 +0800
commitddc440223f72563fb76f7e927a25bd7b70a83f06 (patch)
treee0d3eabb5d87ae89a92adc8265ea72edf4d7c4fe /common
parente8496e06c1d6c3d5ff92682f6d2ae43553e942bc (diff)
downloadpttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar.gz
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar.bz2
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar.lz
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar.xz
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.tar.zst
pttbbs-ddc440223f72563fb76f7e927a25bd7b70a83f06.zip
Fix maxlength counter
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4373 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'common')
-rw-r--r--common/sys/vector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/sys/vector.c b/common/sys/vector.c
index d2c7a565..70931096 100644
--- a/common/sys/vector.c
+++ b/common/sys/vector.c
@@ -102,10 +102,10 @@ Vector_get(struct Vector *self, const int idx)
int
Vector_MaxLen(const struct Vector *list, const int offset, const int count)
{
- int i;
+ int i, j;
int maxlen = 0;
- for(i=offset; i<list->length; i++) {
+ for(i=offset, j=count; i<list->length && j > 0; i++, j--) {
int len = strlen(list->base + list->size * i);
if (len > maxlen)
maxlen = len;