Advertisement
PVS-StudioWarnings

PVS-Studio warning V528 for Snes9x

Nov 26th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. bool RegisterExt(TCHAR *ext) {
  2.   LONG  regResult;
  3.   TCHAR  szRegKey[PATH_MAX];
  4.   TCHAR  szExePath[PATH_MAX];
  5.   TCHAR   *szExeName;
  6.   HKEY  hKey;
  7.  
  8.   if (!ext || ext==TEXT('\0'))
  9.     return false;
  10.   ....
  11. }
  12.  
  13. This suspicious code was found in Snes9x project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V528 It is odd that pointer to 'wchar_t' type is compared with the L'\0' value. Probably meant: *ext == L'\0'. wsnes9x.cpp 6952
  16.  
  17. 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
Advertisement