PVS-StudioWarnings

PVS-Studio warning V576 for CamStudio

Nov 17th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. // Produces a 100% Valid XHTML Strict document to display
  2. // the flash file, which works in all browsers (even IE 4)
  3. void produceFlashHTML(CString htmlfilename,
  4.   CString flashfilename, CString flashfilepath,
  5.   int onlyflashtag, int width, int height,int bk_red,
  6.   int bk_green, int bk_blue)
  7. {
  8.   ....
  9.   fprintf(htmlfile, "<title>%s</title>\n",
  10.     LPCTSTR(flashfilename));
  11.   fprintf(htmlfile, "<style type=\"text/css\">\n");
  12.   fprintf(htmlfile, "#movie\n{\n",
  13.     LPCTSTR(flashfilename)); //<<<
  14.   fprintf(htmlfile, "\twidth: %dpx;\n", width);
  15.   fprintf(htmlfile, "\theight: %dpx;\n", height);
  16.   ...
  17. }
  18.  
  19. I like the comment. How sure the author is! :)
  20.  
  21. This suspicious code was found in CamStudio project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V576 Incorrect format. A different number of actual arguments is expected while calling 'fprintf' function. Expected: 2. Present: 3. playplusview.cpp 7157
  24.  
  25. 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