I am currently, writing a code for string manipulation.
As part of this, I am using vsnprintf().
However, compiler flashes below error message:
dont_call: vsnprintf(). Invokation of a potentially dangerous function
that could introduce a vulnerability. remediation:
Recommendation: Use vsprintf_s() instead!
The results with vsprintf_s() is as not expected.
What is the difference between vsnprintf() and vsprintf_s()?
The solution is to always add
as the first line of code when compiling with Visual Studio. Or maybe the second line if you're writing cross-platform code and the first line is something like
#ifdef _WIN32, such asThis will disable warnings that Microsoft has "deprecated" functions required by the C Standard.