PVS-StudioWarnings

PVS-Studio warning V576 for amtsdk

Nov 20th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. void addAttribute(....)
  2. {
  3.   ...
  4.   int index = _snprintf(temp, 1023,
  5.     "%02x%02x:%02x%02x:%02x%02x:%02x%02x:"
  6.     "%02x%02x:02x%02x:%02x%02x:%02x%02x",
  7.     value[0],value[1],value[2],value[3],value[4],
  8.     value[5],value[6],value[7],value[8],
  9.     value[9],value[10],value[11],value[12],
  10.     value[13],value[14],value[15]);
  11.   ...
  12. }
  13.  
  14. One of the arguments is 02X instead of %02X.
  15.  
  16. This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V576 Incorrect format. A different number of actual arguments is expected while calling '_snprintf' function. Expected: 18. Present: 19. mod_pvs mod_pvs.cpp 308
  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