diff --git a/.gitignore b/.gitignore index fbfae2dd..555ff0d6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ src/bin/vld.ini /src/tests/vld_ComTest/ComTest_p.c /src/tests/vld_ComTest/ComTest_i.c *.VC.opendb +.vs diff --git a/src/utility.cpp b/src/utility.cpp index e3c32fe4..5bf6e4bb 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -717,7 +717,8 @@ VOID Print (LPWSTR messagew) const size_t MAXMESSAGELENGTH = 5119; size_t count = 0; CHAR messagea [MAXMESSAGELENGTH + 1]; - if (wcstombs_s(&count, messagea, MAXMESSAGELENGTH + 1, messagew, _TRUNCATE) != 0) { + errno_t ret = wcstombs_s(&count, messagea, MAXMESSAGELENGTH + 1, messagew, _TRUNCATE); + if (ret != 0 && ret != STRUNCATE) { // Failed to convert the Unicode message to ASCII. assert(FALSE); return;