From 6223c9c8f8da33c27c07ee75d05bd17dacf401c0 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 2 Jul 2019 21:41:52 -0400 Subject: Deal with ~users in colorGen --- color.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'color.c') diff --git a/color.c b/color.c index f713451..dad5647 100644 --- a/color.c +++ b/color.c @@ -29,8 +29,9 @@ static uint32_t hashChar(uint32_t hash, char ch) { enum IRCColor colorGen(const char *str) { if (!str) return IRCDefault; uint32_t hash = 0; - for (; str[0]; ++str) { - hash = hashChar(hash, str[0]); + if (*str == '~') str++; + for (; *str; ++str) { + hash = hashChar(hash, *str); } while (IRCBlack == (hash & IRCLightGray)) { hash = hashChar(hash, '\0'); -- cgit 1.4.1-2-gfad0