Use g_(v)snprintf so we need less wrappers.
--- a/finch/gntaccount.c Wed Oct 30 22:19:59 2019 -0400
+++ b/finch/gntaccount.c Wed Oct 30 23:25:39 2019 -0400
@@ -482,7 +482,7 @@
value = purple_account_get_int(account,
purple_account_option_get_setting(option), value);
- snprintf(str, sizeof(str), "%d", value);
+ g_snprintf(str, sizeof(str), "%d", value); gnt_entry_set_flag(GNT_ENTRY(entry), GNT_ENTRY_FLAG_INT);
gnt_entry_set_text(GNT_ENTRY(entry), str);
--- a/finch/gntrequest.c Wed Oct 30 22:19:59 2019 -0400
+++ b/finch/gntrequest.c Wed Oct 30 23:25:39 2019 -0400
@@ -462,7 +462,7 @@
int val = purple_request_field_int_get_default_value(field);
- snprintf(str, sizeof(str), "%d", val);
+ g_snprintf(str, sizeof(str), "%d", val); entry = gnt_entry_new(str);
gnt_entry_set_flag(GNT_ENTRY(entry), GNT_ENTRY_FLAG_INT);
--- a/libpurple/protocols/bonjour/bonjour_ft.c Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Wed Oct 30 23:25:39 2019 -0400
@@ -1027,8 +1027,9 @@
- for(i = 0; i < 20; i++, p += 2)
- snprintf(p, 3, "%02x", hashval[i]);
+ for (i = 0; i < 20; i++, p += 2) { + g_snprintf(p, 3, "%02x", hashval[i]); xf->proxy_info = purple_proxy_info_new();
purple_proxy_info_set_proxy_type(xf->proxy_info, PURPLE_PROXY_SOCKS5);
--- a/libpurple/protocols/bonjour/mdns_common.c Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/protocols/bonjour/mdns_common.c Wed Oct 30 23:25:39 2019 -0400
@@ -85,7 +85,7 @@
const char *jid, *aim, *email;
/* Convert the port to a string */
- snprintf(portstring, sizeof(portstring), "%d", data->port_p2pj);
+ g_snprintf(portstring, sizeof(portstring), "%d", data->port_p2pj); jid = purple_account_get_string(data->account, "jid", NULL);
aim = purple_account_get_string(data->account, "AIM", NULL);
--- a/libpurple/protocols/bonjour/xmpp.c Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/protocols/bonjour/xmpp.c Wed Oct 30 23:25:39 2019 -0400
@@ -1467,6 +1467,5 @@
!IN6_IS_ADDR_LINKLOCAL(&in6_addr))
- snprintf(ip + strlen(ip), len_remain, "%%%d",
+ g_snprintf(ip + strlen(ip), len_remain, "%%%d", interface_param); --- a/libpurple/protocols/gg/oauth/oauth.c Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/protocols/gg/oauth/oauth.c Wed Oct 30 23:25:39 2019 -0400
@@ -104,9 +104,9 @@
nonce[sizeof(nonce) - 1] = 0;
- if (gg_oauth_static_timestamp == NULL)
- snprintf(timestamp, sizeof(timestamp), "%ld", time(NULL));
+ if (gg_oauth_static_timestamp == NULL) { + g_snprintf(timestamp, sizeof(timestamp), "%ld", time(NULL)); strncpy(timestamp, gg_oauth_static_timestamp, sizeof(timestamp) - 1);
timestamp[sizeof(timestamp) - 1] = 0;
--- a/libpurple/win32/libc_interface.h Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/win32/libc_interface.h Wed Oct 30 23:25:39 2019 -0400
@@ -136,8 +136,6 @@
#if !defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3 || \
!defined(IS_WIN32_CROSS_COMPILED)
-# define snprintf _snprintf
# define vsnprintf _vsnprintf
--- a/libpurple/xmlnode.c Wed Oct 30 22:19:59 2019 -0400
+++ b/libpurple/xmlnode.c Wed Oct 30 23:25:39 2019 -0400
@@ -711,7 +711,7 @@
- vsnprintf(errmsg, sizeof(errmsg), msg, args);
+ g_vsnprintf(errmsg, sizeof(errmsg), msg, args); purple_debug_error("xmlnode", "Error parsing xml file: %s", errmsg);
--- a/pidgin/gtknotify.c Wed Oct 30 22:19:59 2019 -0400
+++ b/pidgin/gtknotify.c Wed Oct 30 23:25:39 2019 -0400
@@ -1157,7 +1157,9 @@
userinfo_hash(PurpleAccount *account, const char *who)
- snprintf(key, sizeof(key), "%s - %s", purple_account_get_username(account), purple_normalize(account, who));
+ g_snprintf(key, sizeof(key), "%s - %s", + purple_account_get_username(account), + purple_normalize(account, who)); return g_utf8_strup(key, -1);
--- a/pidgin/gtkutils.c Wed Oct 30 22:19:59 2019 -0400
+++ b/pidgin/gtkutils.c Wed Oct 30 23:25:39 2019 -0400
@@ -2425,10 +2425,10 @@
gtk_style_context_get_background_color(context,
gtk_style_context_get_state(context),
- snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x",
- (unsigned int)((fg.red + bg.red) * 0.5 * 255),
- (unsigned int)((fg.green + bg.green) * 0.5 * 255),
- (unsigned int)((fg.blue + bg.blue) * 0.5 * 255));
+ g_snprintf(dim_grey_string, sizeof(dim_grey_string), "#%02x%02x%02x", + (unsigned int)((fg.red + bg.red) * 0.5 * 255), + (unsigned int)((fg.green + bg.green) * 0.5 * 255), + (unsigned int)((fg.blue + bg.blue) * 0.5 * 255)); --- a/pidgin/libpidgin.c Wed Oct 30 22:19:59 2019 -0400
+++ b/pidgin/libpidgin.c Wed Oct 30 23:25:39 2019 -0400
@@ -526,31 +526,35 @@
* useful signals like SIGCHLD, so we unblock all the ones we *
* declare a handler for. thanks JSeymour and Vann. */
if (sigemptyset(&sigset)) {
- snprintf(errmsg, sizeof(errmsg), "Warning: couldn't initialise empty signal set");
+ g_snprintf(errmsg, sizeof(errmsg), + "Warning: couldn't initialise empty signal set"); for(sig_indx = 0; catch_sig_list[sig_indx] != -1; ++sig_indx) {
if(signal(catch_sig_list[sig_indx], sighandler) == SIG_ERR) {
- snprintf(errmsg, sizeof(errmsg), "Warning: couldn't set signal %d for catching",
- catch_sig_list[sig_indx]);
+ g_snprintf(errmsg, sizeof(errmsg), + "Warning: couldn't set signal %d for catching", + catch_sig_list[sig_indx]); if(sigaddset(&sigset, catch_sig_list[sig_indx])) {
- snprintf(errmsg, sizeof(errmsg), "Warning: couldn't include signal %d for unblocking",
- catch_sig_list[sig_indx]);
+ g_snprintf(errmsg, sizeof(errmsg), + "Warning: couldn't include signal %d for unblocking", + catch_sig_list[sig_indx]); for(sig_indx = 0; ignore_sig_list[sig_indx] != -1; ++sig_indx) {
if(signal(ignore_sig_list[sig_indx], SIG_IGN) == SIG_ERR) {
- snprintf(errmsg, sizeof(errmsg), "Warning: couldn't set signal %d to ignore",
- ignore_sig_list[sig_indx]);
+ g_snprintf(errmsg, sizeof(errmsg), + "Warning: couldn't set signal %d to ignore", + ignore_sig_list[sig_indx]); if (sigprocmask(SIG_UNBLOCK, &sigset, NULL)) {
- snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals");
+ g_snprintf(errmsg, sizeof(errmsg), "Warning: couldn't unblock signals"); --- a/pidgin/win32/untar.c Wed Oct 30 22:19:59 2019 -0400
+++ b/pidgin/win32/untar.c Wed Oct 30 23:25:39 2019 -0400
@@ -392,8 +392,8 @@
memset(nbuf, 0, sizeof nbuf);
- snprintf(nbuf, sizeof(nbuf), "%s/%s",
- (tblk)->prefix, (tblk)->filename);
+ g_snprintf(nbuf, sizeof(nbuf), "%s/%s", (tblk)->prefix,