changeset 7430:783eea64614c

[gaim-migrate @ 8034] a better fix. gaim_normalize() isn't meant to return NULL. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 05 Nov 2003 00:18:51 +0000
parents 58a426e1bd1a
children 643cbc9a6035
files src/blist.c src/util.c
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Wed Nov 05 00:11:31 2003 +0000
+++ b/src/blist.c	Wed Nov 05 00:18:51 2003 +0000
@@ -1231,9 +1231,6 @@
 	hb.account = account;
 	hb.name = g_strdup(gaim_normalize(account, name));
 
-	if(!hb.name)
-		return NULL;
-
 	for(group = gaimbuddylist->root; group; group = group->next) {
 		hb.group = group;
 		if ((buddy = g_hash_table_lookup(gaimbuddylist->buddies, &hb))) {
--- a/src/util.c	Wed Nov 05 00:11:31 2003 +0000
+++ b/src/util.c	Wed Nov 05 00:18:51 2003 +0000
@@ -1301,6 +1301,7 @@
 {
 	GaimPlugin *prpl = NULL;
 	GaimPluginProtocolInfo *prpl_info = NULL;
+	const char *ret = NULL;
 
 	if(account)
 		prpl = gaim_find_prpl(gaim_account_get_protocol(account));
@@ -1308,9 +1309,10 @@
 	if(prpl)
 		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
 
-	if(prpl_info && prpl_info->normalize) {
-		return prpl_info->normalize(account, s);
-	} else {
+	if(prpl_info && prpl_info->normalize)
+		ret = prpl_info->normalize(account, s);
+
+	if(!ret) {
 		static char buf[BUF_LEN];
 		char *tmp;
 		int i, j;
@@ -1332,8 +1334,9 @@
 		g_snprintf(buf, sizeof(buf), "%s", tmp);
 		g_free(tmp);
 
-		return buf;
+		ret = buf;
 	}
+	return ret;
 }
 
 /* Look for %n, %d, or %t in msg, and replace with the sender's name, date,