Lionel Debroux lionel_debroux@yahoo.fr writes:
- Therefore, "size" bytes of actual data have to be moved from the offset
- they were at in the old block (temp + old_padding) to the offset they
- have to be in the new block (temp + new_padding == memblock).
+*/ if (new_padding != old_padding)
memmove((char *)memblock + old_padding, (char *)memblock + new_padding, size);
memmove((char *)memblock, (char *)temp + old_padding, size);
You also have to take into account the fact that the size may have changed.