From 6ddca97e7c00423a8acc78f3a2acf7554876f1ed Mon Sep 17 00:00:00 2001 From: Yonathan Negussie Mengesha Date: Thu, 12 Sep 2019 17:13:36 +0200 Subject: [PATCH 1/2] Ignore .vs folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From bc6d5089336aaa927a35835c64292aeaad8047fa Mon Sep 17 00:00:00 2001 From: Yonathan Negussie Mengesha Date: Thu, 12 Sep 2019 17:27:58 +0200 Subject: [PATCH 2/2] Prevent assertion when message is truncated --- src/utility.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;