On 9 July 2017 at 18:53, Gerald Pfeifer gerald@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.