Advertisement
PVS-StudioWarnings

PVS-Studio warning V528 for VTK

Nov 25th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. int vtkBYUReader::RequestData(....)
  2. {
  3.   ...
  4.   if (this->GeometryFileName == NULL ||
  5.       this->GeometryFileName == '\0')
  6.   ...
  7. }
  8.  
  9. This is what should have been written here: this->GeometryFileName[0] == '\0'
  10.  
  11. This suspicious code was found in VTK project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V528 It is odd that pointer to 'char' type is compared with the '\0' value. Probably meant: *this->GeometryFileName == '\0'. vtkIO vtkbyureader.cxx 109
  14.  
  15. 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