#1336: fix some compiler warnings when building with -Wformat-security

This commit is contained in:
Charles Kerr
2008-10-09 20:03:34 +00:00
parent e5dd2c60cb
commit 1415b72017
7 changed files with 16 additions and 20 deletions

View File

@@ -131,7 +131,7 @@ blocklistThreadFunc( gpointer gcore )
filename2 = g_strdup_printf( "%s.txt", filename );
cmd = g_strdup_printf( "zcat %s > %s ", filename, filename2 );
tr_dbg( "%s", cmd );
system( cmd );
(void) system( cmd );
g_free( cmd );
}

View File

@@ -250,8 +250,8 @@ confirmRemove( GtkWindow * parent,
"<big><b>%s</b></big>",
primary_text );
if( secondary_text )
gtk_message_dialog_format_secondary_markup( GTK_MESSAGE_DIALOG(
d ), secondary_text );
gtk_message_dialog_format_secondary_markup( GTK_MESSAGE_DIALOG( d ),
"%s", secondary_text );
gtk_dialog_add_buttons( GTK_DIALOG( d ),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
( delete_files ? GTK_STOCK_DELETE :

View File

@@ -999,9 +999,9 @@ flushAddTorrentErrors( GtkWindow * window,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
primary );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(
w ), s->str );
"%s", primary );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ),
"%s", s->str );
g_signal_connect_swapped( w, "response",
G_CALLBACK( gtk_widget_destroy ), w );
gtk_widget_show_all( w );

View File

@@ -456,15 +456,11 @@ onBlocklistStatus( TrCore * core UNUSED,
struct blocklist_data * data = gdata;
gdk_threads_enter( );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(
data->
dialog ),
status );
gtk_dialog_set_response_sensitive( GTK_DIALOG(
data->dialog ),
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( data-> dialog ),
"%s", status );
gtk_dialog_set_response_sensitive( GTK_DIALOG( data->dialog ),
GTK_RESPONSE_CANCEL, !isDone );
gtk_dialog_set_response_sensitive( GTK_DIALOG(
data->dialog ),
gtk_dialog_set_response_sensitive( GTK_DIALOG( data->dialog ),
GTK_RESPONSE_CLOSE, isDone );
if( isDone )
updateBlocklistText( data->check, core );

View File

@@ -395,8 +395,8 @@ addTorrentErrorDialog( GtkWidget * child,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
_( "Error opening torrent" ) );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(
w ), secondary );
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG( w ),
"%s", secondary );
g_signal_connect_swapped( w, "response",
G_CALLBACK( gtk_widget_destroy ), w );
gtk_widget_show_all( w );

View File

@@ -137,9 +137,9 @@ logFunc( int severity,
const char * message )
{
if( severity >= _EVENT_LOG_ERR )
tr_nerr( "%s", message );
tr_err( "%s", message );
else
tr_ndbg( "%s", message );
tr_dbg( "%s", message );
}
static void

View File

@@ -28,7 +28,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> /* strerror */
#include <string.h> /* strerror, memset */
#include <libgen.h> /* basename */
#include <sys/time.h>
@@ -204,7 +204,7 @@ tr_deepLog( const char * file,
evbuffer_add_vprintf( buf, fmt, args );
va_end( args );
evbuffer_add_printf( buf, " (%s:%d)\n", basename( myfile ), line );
fwrite( EVBUFFER_DATA( buf ), 1, EVBUFFER_LENGTH( buf ), fp );
(void) fwrite( EVBUFFER_DATA( buf ), 1, EVBUFFER_LENGTH( buf ), fp );
tr_free( myfile );
evbuffer_free( buf );