Piotr Caban : msvcrt/tests: Fix crash in mbstowcs tests.

Alexandre Julliard julliard at winehq.org
Thu Jan 9 12:52:50 CST 2014


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Jan  9 17:34:05 2014 +0100

msvcrt/tests: Fix crash in mbstowcs tests.

---

 dlls/msvcrt/tests/string.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index 800a06b..71b6815 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -1635,10 +1635,13 @@ static void test_mbstowcs(void)
     wOut[4] = '!'; wOut[5] = '\0';
     mOut[4] = '!'; mOut[5] = '\0';
 
-    errno = 0xdeadbeef;
-    ret = mbstowcs(wOut, NULL, 4);
-    ok(ret == -1, "mbstowcs did not return -1\n");
-    ok(errno == EINVAL, "errno = %d\n", errno);
+    if(pmbstowcs_s) {
+        /* crashes on some systems */
+        errno = 0xdeadbeef;
+        ret = mbstowcs(wOut, NULL, 4);
+        ok(ret == -1, "mbstowcs did not return -1\n");
+        ok(errno == EINVAL, "errno = %d\n", errno);
+    }
 
     ret = mbstowcs(NULL, mSimple, 0);
     ok(ret == 4, "mbstowcs did not return 4\n");




More information about the wine-cvs mailing list