msvcrt heap: fix _aligned_offset_realloc (move correct block of memory); add a comment to explain why. [1/2]

Alexandre Julliard julliard at winehq.org
Tue Nov 27 07:57:56 CST 2007


Lionel Debroux <lionel_debroux at 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.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list