PVS-StudioWarnings

PVS-Studio warning V517 for ReactOS

Nov 10th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #define LOCALE_SSHORTDATE 31
  2. #define LOCALE_SLONGDATE 32
  3.  
  4. MSVCRT__locale_t CDECL MSVCRT__create_locale(....)
  5. {
  6.   ....
  7.   if (time_data[i]==
  8.       LOCALE_SSHORTDATE && !lcid[LC_TIME]) {
  9.     size += ....;
  10.   } else if(time_data[i]==
  11.             LOCALE_SSHORTDATE && !lcid[LC_TIME]) {
  12.     size += ....;
  13.   } else {
  14.   ....
  15. }
  16.  
  17. Most likely this is what should be written here: else if (time_data[i]==LOCALE_SLONGDATE  && !lcid[LC_TIME])
  18.  
  19.  
  20. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 1193, 1195. locale.c 1193
  23.  
  24. 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