mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
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
This commit is contained in:
parent
32e01a5a06
commit
c561ba35e6
30 changed files with 86 additions and 86 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue