PVS-StudioWarnings

PVS-Studio warning V531 for ReactOS

Nov 12th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. VOID
  2. DisplayEvent(HWND hDlg)
  3. {
  4.   WCHAR szEventType[MAX_PATH];
  5.   WCHAR szTime[MAX_PATH];
  6.   WCHAR szDate[MAX_PATH];
  7.   ...
  8.   ListView_GetItemText(hwndListView, iIndex, 0, szEventType,
  9.                        sizeof(szEventType) * sizeof(WCHAR));
  10.   ListView_GetItemText(hwndListView, iIndex, 1, szDate,
  11.                        sizeof(szDate) * sizeof(WCHAR));
  12.   ListView_GetItemText(hwndListView, iIndex, 2, szTime,
  13.                        sizeof(szTime) * sizeof(WCHAR));
  14.   ...
  15. }
  16.  
  17. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V531 It is odd that a sizeof() operator is multiplied by sizeof(). eventvwr eventvwr.c 1112
  20.  
  21. 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