28 Mar
2005
28 Mar
'05
5:59 p.m.
Peter Berg Larsen <pebl(a)math.ku.dk> writes:
This memcpyies one element more than needed.. but seemed much nicer than memcpy( ret, p, (len - 1)*sizeof(WHCAR);
I probably should have subtracted one from len, making it obvious that this is a strdupW, like: ret = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof(WCHAR) ); memcpy( ret, p, len*sizeof(WCHAR) ); ret[len] = 0;
If it's really a strdup it's cleaner to copy one more char and get rid of the ret[len] = 0. -- Alexandre Julliard julliard(a)winehq.org