Hi Guys,
I'm facing with issue in function _vstprintf_s.
I has written a simple program like below:
#include "stdafx.h" #include <stdio.h> #include "afx.h" CString TestVSPrintf(const CString &msgFormat, ...){ TCHAR buffer[256] = {0}; va_list argprt; va_start(argprt, msgFormat); _vstprintf_s(buffer, 255, msgFormat, argprt); va_end(argprt); return buffer; } int _tmain(int argc, _TCHAR* argv[]) { CString d = TestVSPrintf("String: %s", "TestString"); return 0; }
It crashes while coming to line _vstprintf_s with bad pointer (0xcccccccc) access violation error.
I'm using Visual Studio 2005 SP1.
Are there any known issue?