summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-08 23:14:29 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-08 23:15:48 +0200
commitd3b1754e14b6508bddfda674edecbffdafe3d4f8 (patch)
tree62447969720cca2e8fc3fdf8125fdf6adf515e57 /degesch.c
parent24a082b5d896085553676ea2afe836ad03b643e0 (diff)
downloadxK-d3b1754e14b6508bddfda674edecbffdafe3d4f8.tar.gz
xK-d3b1754e14b6508bddfda674edecbffdafe3d4f8.tar.xz
xK-d3b1754e14b6508bddfda674edecbffdafe3d4f8.zip
degesch: introduce transform_str()
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/degesch.c b/degesch.c
index 6c8d1f5..6294316 100644
--- a/degesch.c
+++ b/degesch.c
@@ -4413,12 +4413,10 @@ irc_is_highlight (struct server *s, const char *message)
// Well, this is rather crude but it should make most users happy.
// Ideally we could do this at least in proper Unicode.
char *copy = xstrdup (message);
- for (char *p = copy; *p; p++)
- *p = s->irc_tolower (*p);
+ transform_str (copy, s->irc_tolower);
char *nick = xstrdup (s->irc_user->nickname);
- for (char *p = nick; *p; p++)
- *p = s->irc_tolower (*p);
+ transform_str (nick, s->irc_tolower);
// Special characters allowed in nicknames by RFC 2812: []\`_^{|} and -
// Also excluded from the ASCII: common user channel prefixes: +%@&~
@@ -6825,8 +6823,7 @@ handle_command_ctcp (struct handler_args *a)
return false;
char *tag = cut_word (&a->arguments);
- for (char *p = tag; *p; p++)
- *p = toupper_ascii (*p);
+ transform_str (tag, toupper_ascii);
if (*a->arguments)
irc_send (a->s, "PRIVMSG %s :\x01%s %s\x01", target, tag, a->arguments);