Fix bug in clearing of new storage
authorKen Raeburn <raeburn@mit.edu>
Tue, 4 Sep 2007 23:02:36 +0000 (23:02 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 4 Sep 2007 23:02:36 +0000 (23:02 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19917 dc483132-0cff-0310-8789-dd5450dbe970

src/util/t_array.pm

index d4b2173938491dfa7255cb78958ac68fb2a1d884..19b4c18634314c0e86e7acc1bff832554c37efa7 100644 (file)
@@ -41,6 +41,7 @@ __DATA__
 #include <errno.h>
 #include <limits.h>
 #include <string.h>
+#include <stdint.h>
 
 struct <NAME>__header {
     size_t allocated;
@@ -93,7 +94,7 @@ static inline int
     ptr = realloc(arr->elts, newsize);
     if (ptr == NULL)
        return -1;
-    memset((char *)arr->elts + oldsize, 0, newsize - oldsize);
+    memset((char *)ptr + oldsize, 0, newsize - oldsize);
     arr->elts = ptr;
     arr->allocated = newcount;
     return 0;