summary refs log tree commit diff
path: root/color.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-02 21:41:52 -0400
committerJune McEnroe <june@causal.agency>2019-07-02 21:41:52 -0400
commit6223c9c8f8da33c27c07ee75d05bd17dacf401c0 (patch)
tree23e101ca5da0d1cd227948198174d97300796562 /color.c
parentClean up input parameter handling (diff)
downloadcatgirl-6223c9c8f8da33c27c07ee75d05bd17dacf401c0.tar.gz
catgirl-6223c9c8f8da33c27c07ee75d05bd17dacf401c0.zip
Deal with ~users in colorGen
Diffstat (limited to '')
-rw-r--r--color.c5
1 files changed, 3 insertions, 2 deletions
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');