From 13618b73e353f9016f7c890e6b51eda2229737d1 Mon Sep 17 00:00:00 2001 From: Francois Andriot Date: Thu, 15 Aug 2013 21:03:45 +0200 Subject: Fix 'format not a string literal' error --- plugins/src/inputmethods/xim/qximinputcontext_x11.cpp | 2 +- src/3rdparty/sqlite/btree_rb.c | 2 +- src/3rdparty/sqlite/shell.c | 2 +- src/moc/moc.y | 4 ++-- src/moc/moc_yacc.cpp | 4 ++-- src/sql/drivers/odbc/qsql_odbc.cpp | 8 ++++---- tools/qvfb/qvfbview.cpp | 18 +++++++++--------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp b/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp index 108a31e7a..b631d1916 100644 --- a/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp +++ b/plugins/src/inputmethods/xim/qximinputcontext_x11.cpp @@ -742,7 +742,7 @@ void TQXIMInputContext::resetClientState() void TQXIMInputContext::close( const TQString &errMsg ) { - tqDebug( errMsg ); + tqDebug( "%s", errMsg.latin1() ); emit deletionRequested(); } diff --git a/src/3rdparty/sqlite/btree_rb.c b/src/3rdparty/sqlite/btree_rb.c index ea4b3dda7..09d8e9a1e 100644 --- a/src/3rdparty/sqlite/btree_rb.c +++ b/src/3rdparty/sqlite/btree_rb.c @@ -311,7 +311,7 @@ static char *append_node(char * orig, BtRbNode *pNode, int indent) static void print_node(BtRbNode *pNode) { char * str = append_node(0, pNode, 0); - printf(str); + printf("%s", str); /* Suppress a warning message about print_node() being unused */ (void)print_node; diff --git a/src/3rdparty/sqlite/shell.c b/src/3rdparty/sqlite/shell.c index 58771aa78..93210666e 100644 --- a/src/3rdparty/sqlite/shell.c +++ b/src/3rdparty/sqlite/shell.c @@ -688,7 +688,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ }else if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ - fprintf(stderr,zHelp); + fprintf(stderr,"%s",zHelp); }else if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg>1 ){ diff --git a/src/moc/moc.y b/src/moc/moc.y index 4540262be..b10e444e8 100644 --- a/src/moc/moc.y +++ b/src/moc/moc.y @@ -2873,8 +2873,8 @@ void generateClass() // generate C++ source code for a class fn = &g->fileName[i]; fprintf( out, hdr1, (const char*)qualifiedClassName(),(const char*)fn); fprintf( out, hdr2, (const char*)dstr ); - fprintf( out, hdr3 ); - fprintf( out, hdr4 ); + fprintf( out, "%s", hdr3 ); + fprintf( out, "%s", hdr4 ); if ( !g->noInclude ) { /* diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index 13c38b654..3d6b8cfbe 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -5699,8 +5699,8 @@ void generateClass() // generate C++ source code for a class fn = &g->fileName[i]; fprintf( out, hdr1, (const char*)qualifiedClassName(),(const char*)fn); fprintf( out, hdr2, (const char*)dstr ); - fprintf( out, hdr3 ); - fprintf( out, hdr4 ); + fprintf( out, "%s", hdr3 ); + fprintf( out, "%s", hdr4 ); if ( !g->noInclude ) { /* diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 7abf5c59a..40739b36c 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -539,7 +539,7 @@ bool TQODBCPrivate::setConnectionOptions( const TQString& connOpts ) } else if ( val == "SQL_MODE_READ_WRITE" ) { v = SQL_MODE_READ_WRITE; } else { - tqWarning( TQString( "TQODBCDriver::open: Unknown option value '%1'" ).arg( *it ) ); + tqWarning( "TQODBCDriver::open: Unknown option value '%s'", (*it).latin1() ); break; } r = SQLSetConnectAttr( hDbc, SQL_ATTR_ACCESS_MODE, (SQLPOINTER) v, 0 ); @@ -564,7 +564,7 @@ bool TQODBCPrivate::setConnectionOptions( const TQString& connOpts ) } else if ( val == "SQL_FALSE" ) { v = SQL_FALSE; } else { - tqWarning( TQString( "TQODBCDriver::open: Unknown option value '%1'" ).arg( *it ) ); + tqWarning( "TQODBCDriver::open: Unknown option value '%s'", (*it).latin1() ); break; } r = SQLSetConnectAttr( hDbc, SQL_ATTR_METADATA_ID, (SQLPOINTER) v, 0 ); @@ -586,14 +586,14 @@ bool TQODBCPrivate::setConnectionOptions( const TQString& connOpts ) } else if ( val == "SQL_OPT_TRACE_ON" ) { v = SQL_OPT_TRACE_ON; } else { - tqWarning( TQString( "TQODBCDriver::open: Unknown option value '%1'" ).arg( *it ) ); + tqWarning( "TQODBCDriver::open: Unknown option value '%s'", (*it).latin1() ); break; } r = SQLSetConnectAttr( hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0 ); } #ifdef QT_CHECK_RANGE else { - tqWarning( TQString("TQODBCDriver::open: Unknown connection attribute '%1'").arg( opt ) ); + tqWarning( "TQODBCDriver::open: Unknown connection attribute '%s'", opt.latin1() ); } #endif if ( r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO ) { diff --git a/tools/qvfb/qvfbview.cpp b/tools/qvfb/qvfbview.cpp index a23bab69b..15e5ca53e 100644 --- a/tools/qvfb/qvfbview.cpp +++ b/tools/qvfb/qvfbview.cpp @@ -282,26 +282,26 @@ static TQString qws_dataDir() TQString dataDir = "/tmp/qtembedded-" + username; if ( mkdir( dataDir.latin1(), 0700 ) ) { if ( errno != EEXIST ) { - tqFatal( TQString("Cannot create TQt/Embedded data directory: %1") - .arg( dataDir ) ); + tqFatal( "Cannot create TQt/Embedded data directory: %s", + dataDir.latin1() ); } } struct stat buf; if ( lstat( dataDir.latin1(), &buf ) ) - tqFatal( TQString( "stat failed for TQt/Embedded data directory: %1" ) - .arg( dataDir ) ); + tqFatal( "stat failed for TQt/Embedded data directory: %s", + dataDir.latin1() ); if ( !S_ISDIR( buf.st_mode ) ) - tqFatal( TQString( "%1 is not a directory" ).arg( dataDir ) ); + tqFatal( "%s is not a directory", dataDir.latin1() ); if ( buf.st_uid != getuid() ) - tqFatal( TQString( "TQt/Embedded data directory is not owned by user %1" ) - .arg( getuid() ) ); + tqFatal( "TQt/Embedded data directory is not owned by user %u", + getuid() ); if ( (buf.st_mode & 0677) != 0600 ) - tqFatal( TQString( "TQt/Embedded data directory has incorrect permissions: %1" ) - .arg( dataDir ) ); + tqFatal( "TQt/Embedded data directory has incorrect permissions: %s", + dataDir.latin1() ); dataDir += "/"; -- cgit v1.2.1