Advertisement
PVS-StudioWarnings

PVS-Studio warning V576 for Scilab

Nov 21st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #define FORMAT_SESSION "%s%s%s"
  2.  
  3. char *getCommentDateSession(BOOL longFormat)
  4. {
  5.   ....
  6.   sprintf(line, FORMAT_SESSION, SESSION_PRAGMA_BEGIN,
  7.           STRING_BEGIN_SESSION, time_str, SESSION_PRAGMA_END);
  8.   ....
  9. }
  10.  
  11. This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V576 Incorrect format. A different number of actual arguments is expected while calling 'sprintf' function. Expected: 5. Present: 6. getcommentdatesession.c 68
  14.  
  15. 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
Advertisement