PVS-StudioWarnings

PVS-Studio warning V612 for KDE4

Nov 20th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. BufferFragment split(char c, unsigned int* start)
  2. {
  3.   while (*start < len) {
  4.     int end = indexOf(c, *start);
  5.     if (end == -1) end = len;
  6.     BufferFragment line(d + (*start), end - (*start));
  7.     *start = end + 1;
  8.     return line;
  9.   }
  10.   return BufferFragment();
  11. }
  12.  
  13. This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V612 An unconditional 'return' within a loop. bufferfragment_p.h 94
  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