diff options
author | Alexander Færøy <ahf@irssi.org> | 2009-02-08 17:22:42 +0000 |
---|---|---|
committer | ahf <ahf@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2009-02-08 17:22:42 +0000 |
commit | c561ba35e6aa382124147e88f45683c0021db02f (patch) | |
tree | a0ec48e7655295c69662a9edd396038951527e92 /src/irc/core | |
parent | 32e01a5a06e35c98c478413fb6c86818dd930ff3 (diff) | |
download | irssi-c561ba35e6aa382124147e88f45683c0021db02f.zip |
Code Cleanup:
Use g_string_append_printf() instead of g_string_sprintfa() (which is considered deprecated.)
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5003 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core')
-rw-r--r-- | src/irc/core/bans.c | 8 | ||||
-rw-r--r-- | src/irc/core/channel-rejoin.c | 6 | ||||
-rw-r--r-- | src/irc/core/irc-channels.c | 4 | ||||
-rw-r--r-- | src/irc/core/irc-servers.c | 10 | ||||
-rw-r--r-- | src/irc/core/irc.c | 2 | ||||
-rw-r--r-- | src/irc/core/modes.c | 8 |
6 files changed, 19 insertions, 19 deletions
diff --git a/src/irc/core/bans.c b/src/irc/core/bans.c index 2cdd788b..1d46acb8 100644 --- a/src/irc/core/bans.c +++ b/src/irc/core/bans.c @@ -90,14 +90,14 @@ char *ban_get_masks(IRC_CHANNEL_REC *channel, const char *nicks, int ban_type) for (ban = banlist; *ban != NULL; ban++) { if (strchr(*ban, '!') != NULL) { /* explicit ban */ - g_string_sprintfa(str, "%s ", *ban); + g_string_append_printf(str, "%s ", *ban); continue; } /* ban nick */ realban = ban_get_mask(channel, *ban, ban_type); if (realban != NULL) { - g_string_sprintfa(str, "%s ", realban); + g_string_append_printf(str, "%s ", realban); g_free(realban); } } @@ -143,7 +143,7 @@ void ban_remove(IRC_CHANNEL_REC *channel, const char *bans) rec = tmp->data; if (match_wildcards(*ban, rec->ban)) { - g_string_sprintfa(str, "%s ", rec->ban); + g_string_append_printf(str, "%s ", rec->ban); found = TRUE; } } @@ -161,7 +161,7 @@ void ban_remove(IRC_CHANNEL_REC *channel, const char *bans) atoi(*ban)-1); } if (rec != NULL) - g_string_sprintfa(str, "%s ", rec->ban); + g_string_append_printf(str, "%s ", rec->ban); else if (!channel->synced) g_warning("channel %s is not synced", channel->name); } diff --git a/src/irc/core/channel-rejoin.c b/src/irc/core/channel-rejoin.c index 30e60d19..c9528edc 100644 --- a/src/irc/core/channel-rejoin.c +++ b/src/irc/core/channel-rejoin.c @@ -215,11 +215,11 @@ static void server_rejoin_channels(IRC_SERVER_REC *server) } rec->joining = TRUE; - g_string_sprintfa(channels, "%s,", rec->channel); + g_string_append_printf(channels, "%s,", rec->channel); if (rec->key == NULL) g_string_append(keys, "x,"); else { - g_string_sprintfa(keys, "%s,", rec->key); + g_string_append_printf(keys, "%s,", rec->key); use_keys = TRUE; } } @@ -228,7 +228,7 @@ static void server_rejoin_channels(IRC_SERVER_REC *server) g_string_truncate(channels, channels->len-1); g_string_truncate(keys, keys->len-1); - if (use_keys) g_string_sprintfa(channels, " %s", keys->str); + if (use_keys) g_string_append_printf(channels, " %s", keys->str); server->channels_join(SERVER(server), channels->str, TRUE); } diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c index 99775d30..dd6e29ce 100644 --- a/src/irc/core/irc-channels.c +++ b/src/irc/core/irc-channels.c @@ -106,7 +106,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, if (chanrec == NULL) { schannel = channel_setup_find(channel, server->connrec->chatnet); - g_string_sprintfa(outchans, "%s,", channel); + g_string_append_printf(outchans, "%s,", channel); if (*tmpkey != NULL && **tmpkey != '\0') key = *tmpkey; else if (schannel != NULL && schannel->password != NULL) { @@ -115,7 +115,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data, key = schannel->password; } else key = NULL; - g_string_sprintfa(outkeys, "%s,", get_join_key(key)); + g_string_append_printf(outkeys, "%s,", get_join_key(key)); channame = channel + (channel[0] == '!' && channel[1] == '!'); chanrec = irc_channel_create(server, channame, NULL, diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 6dbd64aa..d0e38640 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -476,8 +476,8 @@ char *irc_server_get_channels(IRC_SERVER_REC *server) for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { CHANNEL_REC *channel = tmp->data; - g_string_sprintfa(chans, "%s,", channel->name); - g_string_sprintfa(keys, "%s,", channel->key == NULL ? "x" : + g_string_append_printf(chans, "%s,", channel->name); + g_string_append_printf(keys, "%s,", channel->key == NULL ? "x" : channel->key); if (channel->key != NULL) use_keys = TRUE; @@ -487,8 +487,8 @@ char *irc_server_get_channels(IRC_SERVER_REC *server) for (tmp = server->rejoin_channels; tmp != NULL; tmp = tmp->next) { REJOIN_REC *rec = tmp->data; - g_string_sprintfa(chans, "%s,", rec->channel); - g_string_sprintfa(keys, "%s,", rec->key == NULL ? "x" : + g_string_append_printf(chans, "%s,", rec->channel); + g_string_append_printf(keys, "%s,", rec->key == NULL ? "x" : rec->key); if (rec->key != NULL) use_keys = TRUE; } @@ -496,7 +496,7 @@ char *irc_server_get_channels(IRC_SERVER_REC *server) if (chans->len > 0) { g_string_truncate(chans, chans->len-1); g_string_truncate(keys, keys->len-1); - if (use_keys) g_string_sprintfa(chans, " %s", keys->str); + if (use_keys) g_string_append_printf(chans, " %s", keys->str); } ret = chans->str; diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index 0286df79..caa9b010 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -202,7 +202,7 @@ void irc_send_cmd_split(IRC_SERVER_REC *server, const char *cmd, tmp = nicklist; for (;; tmp++) { if (*tmp != NULL) { - g_string_sprintfa(nickstr, "%s,", *tmp); + g_string_append_printf(nickstr, "%s,", *tmp); if (++count < max_nicks) continue; } diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index 17464a16..38b457a2 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -577,7 +577,7 @@ void channel_set_singlemode(IRC_CHANNEL_REC *channel, const char *nicks, g_string_insert(str, modepos, mode); } - g_string_sprintfa(str, " %s", *nick); + g_string_append_printf(str, " %s", *nick); if (++num == channel->server->max_modes_in_cmd) { /* max. modes / command reached, send to server */ @@ -659,7 +659,7 @@ void channel_set_mode(IRC_SERVER_REC *server, const char *channel, } if (*arg != '\0') - g_string_sprintfa(targs, " %s", arg); + g_string_append_printf(targs, " %s", arg); } } @@ -695,7 +695,7 @@ static int get_wildcard_nicks(GString *output, const char *mask, if (g_strcasecmp(rec->nick, channel->server->nick) == 0) continue; - g_string_sprintfa(output, "%s ", rec->nick); + g_string_append_printf(output, "%s ", rec->nick); count++; } g_slist_free(nicks); @@ -734,7 +734,7 @@ static char *get_nicks(IRC_SERVER_REC *server, WI_ITEM_REC *item, if (strchr(*match, '*') == NULL && strchr(*match, '?') == NULL) { /* no wildcards */ - g_string_sprintfa(str, "%s ", *match); + g_string_append_printf(str, "%s ", *match); } else { count = get_wildcard_nicks(str, *match, channel, op, voice); |