Advertisement
PVS-StudioWarnings

PVS-Studio warning V528 for Miranda IM

Nov 24th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. static char *_skipblank(char * str)
  2. {
  3.   char * endstr=str+strlen(str);
  4.   while ((*str==' ' || *str=='\t') && str!='\0') str++;
  5.   while ((*endstr==' ' || *endstr=='\t') &&
  6.          endstr!='\0' && endstr<str)
  7.     endstr--;
  8.   ...
  9. }
  10.  
  11. This code is a candidate for access violation: the '*' pointer dereferencing is missing twice.
  12.  
  13. This suspicious code was found in Miranda IM project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V528 It is odd that pointer to 'char' type is compared with the '\0' value. Probably meant: *str != '\0'.  clist_modern  modern_skinbutton.cpp  282
  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