There is a crash in vsprintf_s when we try to print "%q" in string statement. This crash can be avoided by using 2 symbols "%%q"
Is there any way to ignore string printing instead of crashing?
#include <windows.h>
#include <stdio.h>
#define LOG_LEN 1024
void Log( const CHAR * lpszFormat, ...)
{
CHAR localBuff[2 * LOG_LEN + 1] = { 0 };
va_list argp;
va_start(argp, lpszFormat);
vsprintf_s(localBuff, lpszFormat, argp);
va_end(argp);
///...
///...
}
int main()
{
Log("this test is quick"); // this works
Log("this test is%quick"); // this Crashes
}