Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string CExceptionReport::getCrashLog()
- {
- ...
- _tprintf_s(buf, _T("%s\\%s.xml"),
- getenv("TEMP"), CUtility::getAppName());
- ...
- }
- The V510 message warns you that it's a bad idea to pass a parameter of the std::string type into the printf_s function.
- And it is std::string that the CUtility::getAppName() function returns. The error is this: the programmer forgot to write ".c_str()". It may result both in incorrect data output and program crash.
- This suspicious code was found in TortoiseSVN project by PVS-Studio static code analyzer.
- Warning message is:
- V510 The 'printf_s' function is not expected to receive class-type variable as fourth actual argument. excprpt.cpp 199
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment