Fix issues spotted by PVS-Studio
This commit is contained in:
@@ -430,7 +430,6 @@ update_columns (GtkTreeView *view, ViewColumnModel *view_model)
|
||||
int *new_order;
|
||||
GtkTreePath *path;
|
||||
|
||||
new_order = g_new (int, length);
|
||||
a = old_columns; b = view_model->columns;
|
||||
|
||||
while (a->data == b->data)
|
||||
@@ -442,6 +441,8 @@ update_columns (GtkTreeView *view, ViewColumnModel *view_model)
|
||||
m++;
|
||||
}
|
||||
|
||||
new_order = g_new (int, length);
|
||||
|
||||
if (a->next->data == b->data)
|
||||
{
|
||||
b = b->next;
|
||||
|
||||
@@ -9,7 +9,7 @@ static const char *format_name[] = {
|
||||
static const char *
|
||||
format_to_string (GdkMemoryFormat format)
|
||||
{
|
||||
if (format < GDK_MEMORY_N_FORMATS)
|
||||
if (format < g_strv_length ((gchar **) format_name))
|
||||
return format_name[format];
|
||||
else
|
||||
return "ERROR";
|
||||
|
||||
Reference in New Issue
Block a user