Re: Alistair Leslie-Hughes : msvcrt: Implement wcscpy_s.
Alexandre Julliard wrote:
Module: wine Branch: master Commit: 00609d5e7824a117084f3f4b75e1aec03b60102a URL: http://source.winehq.org/git/wine.git/?a=commit;h=00609d5e7824a117084f3f4b75...
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Feb 27 19:58:04 2008 +1100
msvcrt: Implement wcscpy_s.
+ + if(size > numElement)
Is this correct? I think it should be different, maybe if (size<numElement)?
+ { + wcDest[0] = 0; + return MSVCRT_EINVAL; + } + + if(size > numElement)
This and the one above are the same.
+ size = numElement; + + memcpy( wcDest, wcSrc, size*sizeof(WCHAR) ); + + return 0; +}
On Wed, Feb 27, 2008 at 9:03 PM, James McKenzie <jjmckenzie51(a)sprintpcs.com> wrote:
Alexandre Julliard wrote:
Module: wine Branch: master Commit: 00609d5e7824a117084f3f4b75e1aec03b60102a URL: http://source.winehq.org/git/wine.git/?a=commit;h=00609d5e7824a117084f3f4b75...
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Feb 27 19:58:04 2008 +1100
msvcrt: Implement wcscpy_s.
+ + if(size > numElement)
Is this correct? I think it should be different, maybe if
(size<numElement)?
+ { + wcDest[0] = 0; + return MSVCRT_EINVAL; + } + + if(size > numElement)
This and the one above are the same.
If you'll read the tests, you'll see that the first test is correct (although it should really be >= and he should add a test for this). The second check should be removed completely. -- James Hawkins
"James Hawkins" <truiken(a)gmail.com> writes:
If you'll read the tests, you'll see that the first test is correct (although it should really be >= and he should add a test for this).
No, it shouldn't be >=, there's no reason to fail if the buffer is the same size as the data. -- Alexandre Julliard julliard(a)winehq.org
Alexandre Julliard wrote:
"James Hawkins" <truiken(a)gmail.com> writes:
If you'll read the tests, you'll see that the first test is correct (although it should really be >= and he should add a test for this).
No, it shouldn't be >=, there's no reason to fail if the buffer is the same size as the data.
The failure should be when the size of the data is more than the buffer. I think that was the case for the first check. The question was for the second chunk of code. I think that it should have been less than. If the size of the data and the size of the buffer are the same, no change to the size of the buffer is needed. James McKenzie
participants (3)
-
Alexandre Julliard -
James Hawkins -
James McKenzie