diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-10 23:00:56 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-10 23:00:56 +0000 |
commit | dcc2e89b2e0a99645b4f49360c3b76958730563e (patch) | |
tree | 824e1fb77f05e94a3b4cb48e051728eb9bd519a3 /src/fe-common/irc/fe-ctcp.c | |
parent | f8aa81b73c83b97aff8cf24244e0bb183a35d59c (diff) | |
download | irssi-dcc2e89b2e0a99645b4f49360c3b76958730563e.zip |
Enabled lots of GCC warnings, fixed those that were easy to fix.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@456 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-ctcp.c')
-rw-r--r-- | src/fe-common/irc/fe-ctcp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fe-common/irc/fe-ctcp.c b/src/fe-common/irc/fe-ctcp.c index 6d469ba1..ffb5ae62 100644 --- a/src/fe-common/irc/fe-ctcp.c +++ b/src/fe-common/irc/fe-ctcp.c @@ -67,17 +67,23 @@ static void ctcp_time_msg(const char *data, IRC_SERVER_REC *server, const char * static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target) { - char *ptr, *str; + const char *ctcpdata; + char *ctcp, *ptr; g_return_if_fail(data != NULL); - str = g_strdup(data); - ptr = strchr(str, ' '); - if (ptr != NULL) *ptr++ = '\0'; else ptr = ""; + ctcp = g_strdup(data); + ptr = strchr(ctcp, ' '); + if (ptr == NULL) + ctcpdata = ""; + else { + *ptr = '\0'; + ctcpdata = ptr+1; + } printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS, - ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, str, nick, ptr, target); - g_free(str); + ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, ctcp, nick, ctcpdata, target); + g_free(ctcp); } static void ctcp_ping_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target) |