diff options
author | Alexander Færøy <ahf@irssi.org> | 2009-02-08 17:57:19 +0000 |
---|---|---|
committer | ahf <ahf@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2009-02-08 17:57:19 +0000 |
commit | 2fffcf5a77167e03e267664e559267c8fa1d972d (patch) | |
tree | 716e80f8ef45590b14c002a6baa4799c494311f3 /src/irc | |
parent | c561ba35e6aa382124147e88f45683c0021db02f (diff) | |
download | irssi-2fffcf5a77167e03e267664e559267c8fa1d972d.zip |
Code Cleanup:
Use g_string_printf() instead of g_string_sprintf() (which is considered deprecated.)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5004 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/ctcp.c | 2 | ||||
-rw-r--r-- | src/irc/core/irc-commands.c | 14 | ||||
-rw-r--r-- | src/irc/core/modes.c | 2 | ||||
-rw-r--r-- | src/irc/dcc/dcc-get.c | 2 | ||||
-rw-r--r-- | src/irc/proxy/dump.c | 4 | ||||
-rw-r--r-- | src/irc/proxy/listen.c | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c index cc4bd6ca..06fad103 100644 --- a/src/irc/core/ctcp.c +++ b/src/irc/core/ctcp.c @@ -206,7 +206,7 @@ static void ctcp_clientinfo(IRC_SERVER_REC *server, const char *data, g_return_if_fail(nick != NULL); str = g_string_new(NULL); - g_string_sprintf(str, "NOTICE %s :\001CLIENTINFO", nick); + g_string_printf(str, "NOTICE %s :\001CLIENTINFO", nick); for (tmp = ctcp_cmds; tmp != NULL; tmp = tmp->next) { CTCP_CMD_REC *rec = tmp->data; diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index e51aa111..8ee5c9bd 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -78,7 +78,7 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); recoded = recode_out(SERVER(server), msg, target); - g_string_sprintf(tmpstr, "NOTICE %s :%s", target, recoded); + g_string_printf(tmpstr, "NOTICE %s :%s", target, recoded); g_free(recoded); irc_send_cmd_split(server, tmpstr->str, 2, server->max_msgs_in_cmd); @@ -106,12 +106,12 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server, g_strup(ctcpcmd); if (*ctcpdata == '\0') - g_string_sprintf(tmpstr, "PRIVMSG %s :\001%s\001", target, ctcpcmd); + g_string_printf(tmpstr, "PRIVMSG %s :\001%s\001", target, ctcpcmd); else { char *recoded; recoded = recode_out(SERVER(server), ctcpdata, target); - g_string_sprintf(tmpstr, "PRIVMSG %s :\001%s %s\001", target, ctcpcmd, recoded); + g_string_printf(tmpstr, "PRIVMSG %s :\001%s %s\001", target, ctcpcmd, recoded); g_free(recoded); } @@ -140,7 +140,7 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server, g_strup(ctcpcmd); recoded = recode_out(SERVER(server), ctcpdata, target); - g_string_sprintf(tmpstr, "NOTICE %s :\001%s %s\001", target, ctcpcmd, recoded); + g_string_printf(tmpstr, "NOTICE %s :\001%s %s\001", target, ctcpcmd, recoded); g_free(recoded); irc_send_cmd_split(server, tmpstr->str, 2, server->max_msgs_in_cmd); @@ -194,7 +194,7 @@ static void cmd_kick(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item if (!ischannel(*channame)) cmd_param_error(CMDERR_NOT_JOINED); recoded = recode_out(SERVER(server), reason, channame); - g_string_sprintf(tmpstr, "KICK %s %s :%s", channame, nicks, recoded); + g_string_printf(tmpstr, "KICK %s %s :%s", channame, nicks, recoded); g_free(recoded); irc_send_cmd_split(server, tmpstr->str, 3, server->max_kicks_in_cmd); @@ -415,9 +415,9 @@ static void cmd_whois(const char *data, IRC_SERVER_REC *server, event_402 = "event 402"; if (*qserver == '\0') - g_string_sprintf(tmpstr, "WHOIS %s", query); + g_string_printf(tmpstr, "WHOIS %s", query); else { - g_string_sprintf(tmpstr, "WHOIS %s %s", qserver, query); + g_string_printf(tmpstr, "WHOIS %s %s", qserver, query); if (g_strcasecmp(qserver, query) == 0) event_402 = "whois event not found"; } diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index 38b457a2..f204c801 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -569,7 +569,7 @@ void channel_set_singlemode(IRC_CHANNEL_REC *channel, const char *nicks, if (num == 0) { - g_string_sprintf(str, "MODE %s %s", + g_string_printf(str, "MODE %s %s", channel->name, mode); modepos = str->len; } else { diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index 87d4cfb6..bdcd2424 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -73,7 +73,7 @@ static char *dcc_get_rename_file(const char *fname) newname = g_string_new(NULL); num = 1; do { - g_string_sprintf(newname, "%s.%d", fname, num); + g_string_printf(newname, "%s.%d", fname, num); num++; } while (stat(newname->str, &statbuf) == 0); diff --git a/src/irc/proxy/dump.c b/src/irc/proxy/dump.c index 17ba382d..72bc5b6c 100644 --- a/src/irc/proxy/dump.c +++ b/src/irc/proxy/dump.c @@ -144,7 +144,7 @@ void proxy_outserver_all_except(CLIENT_REC *client, const char *data, ...) static void create_names_start(GString *str, IRC_CHANNEL_REC *channel, CLIENT_REC *client) { - g_string_sprintf(str, ":%s 353 %s %c %s :", + g_string_printf(str, ":%s 353 %s %c %s :", client->proxy_address, client->nick, channel_mode_is_set(channel, 'p') ? '*' : channel_mode_is_set(channel, 's') ? '@' : '=', @@ -270,7 +270,7 @@ void proxy_dump_data(CLIENT_REC *client) g_string_append_printf(paramstr, " :are supported by this server\n"); proxy_outdata(client, "%s", paramstr->str); g_string_truncate(paramstr, 0); - g_string_sprintf(paramstr, ":%s 005 %s ", client->proxy_address, client->nick); + g_string_printf(paramstr, ":%s 005 %s ", client->proxy_address, client->nick); if (*tmp == NULL || tmp[1] == NULL) break; diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index 5f473a34..57318642 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -370,7 +370,7 @@ static void sig_incoming(IRC_SERVER_REC *server, const char *line) g_return_if_fail(line != NULL); /* send server event to all clients */ - g_string_sprintf(next_line, "%s\n", line); + g_string_printf(next_line, "%s\n", line); } static void sig_server_event(IRC_SERVER_REC *server, const char *line, |