clear -Werror=format-security warnings

This commit is contained in:
IgnorantGuru 2013-03-03 10:07:43 -07:00
parent 72f9cf2b3d
commit bc7687f5df
2 changed files with 11 additions and 11 deletions

View File

@ -1129,16 +1129,16 @@ void info_partition( device_t *device )
size = sysfs_get_uint64 (device->native_path, "size");
alignment_offset = sysfs_get_uint64 (device->native_path, "alignment_offset");
device->partition_size = g_strdup_printf( "%d", size * 512 );
device->partition_alignment_offset = g_strdup_printf( "%d", alignment_offset );
device->partition_size = g_strdup_printf( "%lu", size * 512 );
device->partition_alignment_offset = g_strdup_printf( "%lu", alignment_offset );
offset = sysfs_get_uint64 (device->native_path, "start") * device->device_block_size;
device->partition_offset = g_strdup_printf( "%d", offset );
device->partition_offset = g_strdup_printf( "%lu", offset );
s = device->native_path;
for (n = strlen (s) - 1; n >= 0 && g_ascii_isdigit (s[n]); n--)
;
device->partition_number = g_strdup_printf( "%d", strtol (s + n + 1, NULL, 0) );
device->partition_number = g_strdup_printf( "%ld", strtol (s + n + 1, NULL, 0) );
/*
s = g_strdup (device->priv->native_path);
for (n = strlen (s) - 1; n >= 0 && s[n] != '/'; n--)
@ -1384,7 +1384,7 @@ char* device_show_info( device_t *device )
line[i++] = g_strdup_printf(" partition:\n");
line[i++] = g_strdup_printf(" scheme: %s\n", device->partition_scheme ?
device->partition_scheme : "" );
line[i++] = g_strdup_printf(" number: %d\n", device->partition_number ?
line[i++] = g_strdup_printf(" number: %s\n", device->partition_number ?
device->partition_number : "" );
line[i++] = g_strdup_printf(" type: %s\n", device->partition_type ?
device->partition_type : "" );

View File

@ -685,9 +685,9 @@ char *replace_string( const char* orig, const char* str, const char* replace,
if ( !replace )
{
if ( quote )
rep = g_strdup_printf( "''" );
rep = g_strdup( "''" );
else
rep = g_strdup_printf( "" );
rep = g_strdup( "" );
}
else if ( quote )
rep = g_strdup_printf( "'%s'", replace );
@ -1143,7 +1143,7 @@ static void dump_log()
}
if ( file )
{
if ( fprintf( file, logmem ) < 1 )
if ( fprintf( file, logmem, NULL ) < 1 )
fail = TRUE;
if ( fclose( file ) != 0 )
fail = TRUE;
@ -2065,9 +2065,9 @@ static int try_umount( const char* device_file, gboolean force, gboolean lazy )
// success - show output
wlog( _("udevil: success running umount as current user\n"), NULL, 1 );
if ( sstderr )
fprintf( stderr, sstderr );
fprintf( stderr, sstderr, NULL );
if ( sstdout )
fprintf( stdout, sstdout );
fprintf( stdout, sstdout, NULL );
g_free( sstdout );
g_free( sstderr );
return 0;
@ -4056,7 +4056,7 @@ _get_type:
{
if ( !valid_mount_path( point, &str ) )
{
printf( str );
printf( str, NULL );
g_free( str );
ret = 2;
goto _finish;