PVS-StudioWarnings

PVS-Studio warning V568 for iecsdk

Nov 24th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. int plh_read_pl_folder(PPLH_PL_FOLDER_INFO pconfig) {
  2.   ...
  3.   WIN32_FIND_DATA file_data;
  4.   ...
  5.   memset(
  6.     &file_data,
  7.     0,
  8.     sizeof(&file_data)
  9.   );
  10.   ...
  11. }
  12.  
  13. This is what should have been written here: sizeof(file_data)
  14.  
  15.  
  16. This suspicious code was found in iecsdk project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V568 It's odd that the argument of sizeof() operator is the '& file_data' expression. pl_csv_logger productivity_link_helper.c 1667
  19.  
  20. 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