user.exe16: Fix an incorrect use of ADD_TO_T in FormatMessage16.
Henri Verbeet
hverbeet at gmail.com
Mon Jul 10 04:05:07 CDT 2017
On 9 July 2017 at 18:53, Gerald Pfeifer <gerald at pfeifer.com> wrote:
> ADD_TO_T actually consists of two statements
>
> #define ADD_TO_T(c) \
> *t++=c;\
> if (t-target == talloced) {\
> target = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
> t = target+talloced;\
> talloced*=2;\
> }
>
> so
>
> for (x=b; *x; x++) ADD_TO_T(*x);
>
> does _not_ actually do what one might expect/hope.
>
> Fixed thusly, in line with other usage.
>
Alternatively, it shouldn't be hard to either fix the macro or replace
it with a function.
More information about the wine-devel
mailing list