From 35e0e1a7c06dea45921b51df5004a7a7579406c2 Mon Sep 17 00:00:00 2001 From: leitner Date: Fri, 10 Oct 2003 01:10:22 +0000 Subject: [PATCH] that wasn't it --- array/array_allocate.c | 2 +- array/array_get.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/array/array_allocate.c b/array/array_allocate.c index db86ad5..b84f0f9 100644 --- a/array/array_allocate.c +++ b/array/array_allocate.c @@ -56,7 +56,7 @@ void* array_allocate(array* x,uint64 membersize,int64 pos) { /* second case of overflow: pos*membersize too large */ if (__unlikely(!umult64(membersize,pos+1,&wanted))) return 0; - if (__unlikely(wanted > x->allocated)) { + if (__unlikely(wanted >= x->allocated)) { /* round up a little */ if (membersize<8) wanted=(wanted+127)&(-128ll); /* round up to multiple of 128 */ diff --git a/array/array_get.c b/array/array_get.c index e10195b..2cc4e20 100644 --- a/array/array_get.c +++ b/array/array_get.c @@ -25,6 +25,6 @@ void* array_get(array* x,uint64 membersize,int64 pos) { if (__unlikely(pos+1<1)) return 0; if (__unlikely(!umult64(membersize,pos,&wanted))) return 0; - if (__unlikely(wanted > x->allocated)) return 0; + if (__unlikely(wanted >= x->allocated)) return 0; return x->p+pos*membersize; }