From 40627dc8317d748cfa3f334e8cc3d52de0317988 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 31 Jan 2010 18:02:02 +0000 Subject: [PATCH] (trunk gtk) #2845 ""-2147483648" of type `gint' is invalid or out of range" -- fixed in trunk for 1.90 --- gtk/file-list.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/file-list.c b/gtk/file-list.c index 6217fb685..5ac37b109 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -111,7 +111,7 @@ refreshFilesForeach( GtkTreeModel * model, const int enabled = tr_torrentGetFileDL( tor, index ); const int priority = tr_torrentGetFilePriority( tor, index ); const uint64_t have = data->refresh_file_stat[index].bytesCompleted; - const int prog = (int)((100.0*have)/size); + const int prog = size ? (int)((100.0*have)/size) : 1; if( (priority!=old_priority) || (enabled!=old_enabled) || (have!=old_have) || (prog!=old_prog) ) gtk_tree_store_set( data->store, iter, FC_PRIORITY, priority, @@ -159,7 +159,7 @@ refreshFilesForeach( GtkTreeModel * model, } while( gtk_tree_model_iter_next( model, &child ) ); - prog = (int)((100.0*have)/sub_size); + prog = sub_size ? (int)((100.0*have)/sub_size) : 1; if( (size!=sub_size) || (have!=old_have) || (priority!=old_priority)