diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-12-23 14:41:28 +0100 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-12-23 05:41:28 -0800 |
commit | f5cbe4c9cab2873b60cd3c991732a250d2e164a2 (patch) | |
tree | 3dfef3ef56990e19fb914821ed4e6f36c9931fd1 /src/utilcode | |
parent | 5ef3df8ffe059d5f91c6bae09d8f95a0332f1363 (diff) | |
download | coreclr-f5cbe4c9cab2873b60cd3c991732a250d2e164a2.tar.gz coreclr-f5cbe4c9cab2873b60cd3c991732a250d2e164a2.tar.bz2 coreclr-f5cbe4c9cab2873b60cd3c991732a250d2e164a2.zip |
Remove all usage of vsnprintf (#8709)
This change removes all usages of vsnprintf and modifies runtime to not to use
vsnprintf or _vsnprintf
I've also fixed two issues in PAL TRACE function string format parameters that
caused crashes when I was trying to run all PAL tests with PAL tracing enabled.
Diffstat (limited to 'src/utilcode')
-rw-r--r-- | src/utilcode/log.cpp | 2 | ||||
-rw-r--r-- | src/utilcode/sstring.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/utilcode/log.cpp b/src/utilcode/log.cpp index 0dc85527c0..c07ac8baff 100644 --- a/src/utilcode/log.cpp +++ b/src/utilcode/log.cpp @@ -325,7 +325,7 @@ VOID LogSpewAlwaysValist(const char *fmt, va_list args) needsPrefix = (fmt[strlen(fmt)-1] == '\n'); - int cCountWritten = _vsnprintf(&pBuffer[buflen], BUFFERSIZE-buflen, fmt, args ); + int cCountWritten = _vsnprintf_s(&pBuffer[buflen], BUFFERSIZE-buflen, _TRUNCATE, fmt, args ); pBuffer[BUFFERSIZE-1] = 0; if (cCountWritten < 0) { buflen = BUFFERSIZE - 1; diff --git a/src/utilcode/sstring.cpp b/src/utilcode/sstring.cpp index ce532d70f6..7c332e08c3 100644 --- a/src/utilcode/sstring.cpp +++ b/src/utilcode/sstring.cpp @@ -2107,7 +2107,7 @@ void SString::VPrintf(const CHAR *format, va_list args) else if (errno!=0 && errno!=EBADF && errno!=ERANGE) { - CONSISTENCY_CHECK_MSG(FALSE, "_vsnprintf failed. Potential globalization bug."); + CONSISTENCY_CHECK_MSG(FALSE, "_vsnprintf_s failed. Potential globalization bug."); ThrowHR(HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)); } } |