From 8fd1d48723b5aa9e0e7cd1f5862be5be61b02783 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 21 Aug 2011 13:55:06 +0200 Subject: irc: use color "default" for any invalid color in option weechat.color.chat_nick_colors --- src/plugins/irc/irc-nick.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/irc') diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c index 3165ac66c..9656ff409 100644 --- a/src/plugins/irc/irc-nick.c +++ b/src/plugins/irc/irc-nick.c @@ -169,7 +169,7 @@ irc_nick_find_color (const char *nickname) { int color; char *nickname2; - const char *forced_color; + const char *forced_color, *str_color; if (!irc_config_nick_colors) irc_config_set_nick_colors (); @@ -199,7 +199,8 @@ irc_nick_find_color (const char *nickname) free (nickname2); /* return color */ - return weechat_color (irc_config_nick_colors[color]); + str_color = weechat_color (irc_config_nick_colors[color]); + return (str_color[0]) ? str_color : weechat_color("default"); } /* -- cgit v1.2.3