comparison src/connection.c @ 14035:8bda65b88e49

[gaim-migrate @ 16638] A bunch of small changes. Mostly remove "if not null" checks before calling g_free, g_list_free, g_slist_free and g_strdup. Also use g_list_foreach() to call g_free to free strings in an array. And some whitespace changes here and there. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Aug 2006 08:27:39 +0000
parents 9c0885611b27
children
comparison
equal deleted inserted replaced
14034:0839a7b71325 14035:8bda65b88e49
335 void 335 void
336 gaim_connection_set_display_name(GaimConnection *gc, const char *name) 336 gaim_connection_set_display_name(GaimConnection *gc, const char *name)
337 { 337 {
338 g_return_if_fail(gc != NULL); 338 g_return_if_fail(gc != NULL);
339 339
340 if (gc->display_name != NULL) 340 g_free(gc->display_name);
341 g_free(gc->display_name); 341 gc->display_name = g_strdup(name);
342
343 gc->display_name = (name == NULL ? NULL : g_strdup(name));
344 } 342 }
345 343
346 GaimConnectionState 344 GaimConnectionState
347 gaim_connection_get_state(const GaimConnection *gc) 345 gaim_connection_get_state(const GaimConnection *gc)
348 { 346 {