[Win32utils-devel] win32-file: nread and nwrite
win32utils-devel at rubyforge.org
win32utils-devel at rubyforge.org
Wed Nov 17 10:34:06 EST 2004
<snip>
> That is due to a common pitfall of malloc :)
>
> Insert
> memset(lpBuffer,0x00,dwBytesToRead+1);
> after
> lpBuffer = (char*)malloc(dwBytesToRead+1);
>
> Regards,
>
> Park Heesob
Thanks. Seems a strange thing to have to do. I understand what memset
does, but I'm not entirely clear why I need it with malloc. I'll read
up on it some more.
Dan
More information about the win32utils-devel
mailing list