Gerald Pfeifer gerald@pfeifer.com writes:
wszDstPath is an array of WCHAR, which are wider than one byte, so this should have been (MAXPATH+1)*sizeof(WCHAR) -- or the more robust approach I here propose.
Actually there's no reason to initialize the entire buffer.
On Wed, 18 May 2016, Alexandre Julliard wrote:
wszDstPath is an array of WCHAR, which are wider than one byte, so this should have been (MAXPATH+1)*sizeof(WCHAR) -- or the more robust approach I here propose.
Actually there's no reason to initialize the entire buffer.
And MAXPATH+1 is correct? Or is that arbitrary as well?
Initialized an array of WCHAR to the size the array would have were it an array of char feels quite unintuitive, so at least a comment would be good.
Gerald
Gerald Pfeifer gerald@pfeifer.com writes:
On Wed, 18 May 2016, Alexandre Julliard wrote:
Actually there's no reason to initialize the entire buffer.
And MAXPATH+1 is correct? Or is that arbitrary as well?
Initialized an array of WCHAR to the size the array would have were it an array of char feels quite unintuitive, so at least a comment would be good.
MAXPATH+1 is definitely wrong. The intent was clearly to fill the whole buffer, and if this is what we wanted, your fix would be correct. My point is that we don't need to fill the whole buffer, so fixing it the right way would be better.