On Wed, 2005-03-16 at 18:54, Ann and Jason Edmeades wrote:
> Nice bug:
>
> WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1);
> #define ALLOC_N_OBJ(type, count) (type *)HeapAlloc(me_heap, 0,
> count*sizeof(type))
>
> becomes
> (WCHAR *)HeapAlloc(me_heap, 0, nLen+1*sizeof(WCHAR))
>
> and by precedence rules
Ann and Jason Edmeades wrote:
WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1);
#define ALLOC_N_OBJ(type, count) (type *)HeapAlloc(me_heap, 0,
count*sizeof(type))
That is so embarrasing! They teach this in the nursery school :/
By coincidence, I've spent at least half an hour today on finding the
memory over