From fe63ed318317f4ca91ad5e56a4d77c879b97c8e6 Mon Sep 17 00:00:00 2001 From: Evan Klitzke Date: Wed, 20 May 2015 15:19:14 -0700 Subject: teach nick_lc to handle # and other non-letters correctly --- nick.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nick.c') diff --git a/nick.c b/nick.c index fb84f986..31cf4f34 100644 --- a/nick.c +++ b/nick.c @@ -367,9 +367,13 @@ int nick_lc(irc_t *irc, char *nick) int i; if (tab['A'] == 0) { + /* initialize table so nonchars are mapped to themselves */ + for (i = 0; i < sizeof(tab); i++) { + tab[i] = i; + } + /* replace uppercase chars with lowercase chars */ for (i = 0; nick_lc_chars[i]; i++) { tab[(int) nick_uc_chars[i]] = nick_lc_chars[i]; - tab[(int) nick_lc_chars[i]] = nick_lc_chars[i]; } } -- cgit v1.2.3