Jon Griffiths : msvcrt: Follow Vista behaviour in wcscpy_s.

Alexandre Julliard julliard at winehq.org
Wed May 28 04:56:54 CDT 2008


Module: wine
Branch: master
Commit: b86915382d50c33ce863b8a1997f9c2c86cb3ac3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b86915382d50c33ce863b8a1997f9c2c86cb3ac3

Author: Jon Griffiths <jon_p_griffiths at yahoo.com>
Date:   Mon May 26 08:21:13 2008 -0700

msvcrt: Follow Vista behaviour in wcscpy_s.

---

 dlls/msvcrt/wcs.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index c6f3e95..14daf90 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -979,27 +979,21 @@ INT CDECL MSVCRT_wcscpy_s( MSVCRT_wchar_t* wcDest, MSVCRT_size_t numElement, con
 {
     INT size = 0;
 
-    if(!wcDest)
+    if(!wcDest || !numElement)
         return MSVCRT_EINVAL;
 
+    wcDest[0] = 0;
+
     if(!wcSrc)
     {
-        wcDest[0] = 0;
         return MSVCRT_EINVAL;
     }
 
-    if(numElement == 0)
-    {
-        wcDest[0] = 0;
-        return MSVCRT_ERANGE;
-    }
-
     size = strlenW(wcSrc) + 1;
 
     if(size > numElement)
     {
-        wcDest[0] = 0;
-        return MSVCRT_EINVAL;
+        return MSVCRT_ERANGE;
     }
 
     if(size > numElement)




More information about the wine-cvs mailing list