diff options
author | Matthias Clasen <maclas@gmx.de> | 2003-11-07 21:57:20 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-11-07 21:57:20 +0000 |
commit | 96fb3e88328b3c268c503818e6fa8a7c210277c5 (patch) | |
tree | a95ee7f247bed4c5cc9ebaa05c4dc90b4a0b4259 /gtk/gtktreeviewcolumn.c | |
parent | 1ed2fe4a640d876b2857411ee40679156790c992 (diff) | |
download | gtk+-96fb3e88328b3c268c503818e6fa8a7c210277c5.tar.gz |
Make string setters safe for self-assignment. (#122745, Soeren Sandmann)
Fri Nov 7 22:55:49 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkwindow.c (gtk_window_set_role):
* gtk/gtkwindow.c (gtk_window_set_title):
* gtk/gtkwidget.c (gtk_widget_set_name):
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_title):
* gtk/gtkbutton.c (gtk_button_set_label): Make string setters
safe for self-assignment. (#122745, Soeren Sandmann)
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r-- | gtk/gtktreeviewcolumn.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 82d8b7a539..4e176ff5cc 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -2024,13 +2024,13 @@ void gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column, const gchar *title) { + gchar *new_title; + g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column)); + new_title = g_strdup (title); g_free (tree_column->title); - if (title) - tree_column->title = g_strdup (title); - else - tree_column->title = NULL; + tree_column->title = new_title; gtk_tree_view_column_update_button (tree_column); g_object_notify (G_OBJECT (tree_column), "title"); |