libbb: fix thinko in latest xrealloc_vector change
authorDenis Vlasenko <vda.linux@googlemail.com>
Tue, 5 Aug 2008 21:12:00 +0000 (21:12 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Tue, 5 Aug 2008 21:12:00 +0000 (21:12 -0000)
libbb/xrealloc_vector.c

index 342ae536eb19e5b5e80d49983e07a68bb09bd178..43c34b720867b458739cbc564e06b63a6e406553 100644 (file)
@@ -39,7 +39,7 @@ void* FAST_FUNC xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift,
        if (!(idx & (mask - 1))) {
                sizeof_and_shift >>= 8; /* sizeof(vector[0]) */
                vector = xrealloc(vector, sizeof_and_shift * (idx + mask + 1));
-               vector += idx;
+               vector = (char*)vector + (sizeof_and_shift * idx);
                memset(vector, 0, sizeof_and_shift * (mask + 1));
        }
        return vector;