On Wed, Apr 9, 2008 at 11:54 AM, Andrew Talbot
<[EMAIL PROTECTED]> wrote:
> Robert Shearman wrote:
>  > This is incorrect. count is the size in bytes of the buffer passed in
>  > (szName) and so should be sizeof(szName) not
>  > sizeof(szName)/sizeof(szName[0]) (i.e. 80).
>  >
>
Andrew T is right about arrays being decayed to pointers when passed
into functions, so sizeof(szName) is going to reuturn 4 or 8 or
whatever.  If count needs to be the size of the buffer shouldn't it
be:

count = NAME_SIZE * sizeof(WCHAR);

but probably better would be DMO_MAX_NAME_SIZE and be in a header
somewhere (dmo.h?)?

Regards,
John


Reply via email to