- vec_ri = (unsigned char *)realloc (vec_ri, vec_max * 4);
- vec_ro = (unsigned char *)realloc (vec_ro, vec_max * 4); /* could free/malloc */
- vec_wi = (unsigned char *)realloc (vec_wi, vec_max * 4);
- vec_wo = (unsigned char *)realloc (vec_wo, vec_max * 4); /* could free/malloc */
+ vec_ri = (unsigned char *)realloc (vec_ri, new_max * 4);
+ vec_ro = (unsigned char *)realloc (vec_ro, new_max * 4); /* could free/malloc */
+ vec_wi = (unsigned char *)realloc (vec_wi, new_max * 4);
+ vec_wo = (unsigned char *)realloc (vec_wo, new_max * 4); /* could free/malloc */
+
+ for (; vec_max < new_max; ++vec_max)
+ ((uint32_t *)vec_ri)[vec_max] =
+ ((uint32_t *)vec_wi)[vec_max] = 0;