Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


[PATCH] printf without format considered harmful

 svtools/bmpmaker/bmp.cxx    |    2 +-
 svtools/bmpmaker/bmpsum.cxx |    2 +-
 svtools/bmpmaker/g2g.cxx    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

 basic/source/app/msgedit.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx
index b5de769..78c8c94 100644
--- a/svtools/bmpmaker/bmp.cxx
+++ b/svtools/bmpmaker/bmp.cxx
@@ -161,7 +161,7 @@ void BmpApp::Message( const String& rText, BYTE cExit )

     ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
     aText.Append( "\r\n" );
-    fprintf( stderr, aText.GetBuffer() );
+    fprintf( stderr, "%s", aText.GetBuffer() );
 }

 // -----------------------------------------------------------------------------
diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx
index 574f7f6..3a5eef6 100644
--- a/svtools/bmpmaker/bmpsum.cxx
+++ b/svtools/bmpmaker/bmpsum.cxx
@@ -167,7 +167,7 @@ void BmpSum::Message( const String& rText, BYTE nExitCode )

     ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
     aText.Append( "\r\n" );
-    fprintf( stderr, aText.GetBuffer() );
+    fprintf( stderr, "%s", aText.GetBuffer() );
 }

 // -----------------------------------------------------------------------------
diff --git a/svtools/bmpmaker/g2g.cxx b/svtools/bmpmaker/g2g.cxx
index dbdb9ac..7dc52d8 100644
--- a/svtools/bmpmaker/g2g.cxx
+++ b/svtools/bmpmaker/g2g.cxx
@@ -125,7 +125,7 @@ void G2GApp::Message( const String& rText, BYTE nExitCode )

     ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
     aText.Append( "\r\n" );
-    fprintf( stderr, aText.GetBuffer() );
+    fprintf( stderr, "%s", aText.GetBuffer() );
 }

 // -----------------------------------------------------------------------------
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index bb22390..1dbade0 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -217,7 +217,7 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg )
                 // restore Original Msg
                 LogMsg->aDebugData.aMsg = aOriginalMsg;

-                printf( ByteString( aPrintMsg, RTL_TEXTENCODING_UTF8
).GetBuffer() );
+                printf( "%s", ByteString( aPrintMsg,
RTL_TEXTENCODING_UTF8 ).GetBuffer() );
             }
         }
     }
--

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.