3
I downloaded a C++ code from the internet and when I open the solution, the following error:
Error C4996 'strcpy': This Function or variable may be unsafe. Consider using strcpy_s Instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
Following the instruction, I modified the strcpy
for strcpy_s
. But generated other 2 errors:
C2660 'strcpy_s' error: function does not take 2 arguments.
Error (active) E0304 no overworked function instance "strcpy_s" corresponds to the list of arguments.
Why did the first error occur? What am I doing wrong?
Code:
strcpy((char*)m_pOriginalCVar->pszName, m_szDummyName);
What is the type of
m_szDummyName
?– bfavaretto
@bfavaretto
char[128]
– Francisco
Like the mustache said
strcpy
is passive from bufferoverflow attacks and so created thestrcpy_s
that copies only a specific font size– Isac