pidgin/pidgin

4c3ee00e6107
Parents 1db26307f960
Children 1f67d7260477
Replace g_strdup_printf("%s", string) with g_strdup(string)

Reduce duplication after replacing where applicable.

Reviewed at https://reviews.imfreedom.org/r/420/
--- a/finch/gntconv.c Tue Jan 12 00:28:54 2021 -0600
+++ b/finch/gntconv.c Wed Jan 13 04:35:22 2021 -0600
@@ -920,7 +920,7 @@
msgflags = gnt_color_pair(color_message_action);
me = TRUE;
} else {
- name = g_strdup_printf("%s", purple_message_get_author_alias(msg));
+ name = g_strdup(purple_message_get_author_alias(msg));
if (flags & PURPLE_MESSAGE_SEND)
msgflags = gnt_color_pair(color_message_send);
else if (flags & PURPLE_MESSAGE_NICK)
--- a/finch/gntlog.c Tue Jan 12 00:28:54 2021 -0600
+++ b/finch/gntlog.c Wed Jan 13 04:35:22 2021 -0600
@@ -307,7 +307,7 @@
gnt_box_add_widget(GNT_BOX(lv->window), vbox);
/* Label ************/
- text = g_strdup_printf("%s", title);
+ text = g_strdup(title);
lv->label = gnt_label_new_with_format(text, GNT_TEXT_FLAG_BOLD);
g_free(text);
gnt_box_add_widget(GNT_BOX(vbox), lv->label);
--- a/libpurple/protocols/bonjour/mdns_avahi.c Tue Jan 12 00:28:54 2021 -0600
+++ b/libpurple/protocols/bonjour/mdns_avahi.c Wed Jan 13 04:35:22 2021 -0600
@@ -189,12 +189,11 @@
bb->ips = g_slist_remove(bb->ips, rd->ip);
g_free((gchar *) rd->ip);
}
+ rd->ip = g_strdup(ip);
/* IPv6 goes at the front of the list and IPv4 at the end so that we "prefer" IPv6, if present */
if (protocol == AVAHI_PROTO_INET6) {
- rd->ip = g_strdup_printf("%s", ip);
bb->ips = g_slist_prepend(bb->ips, (gchar *) rd->ip);
} else {
- rd->ip = g_strdup(ip);
bb->ips = g_slist_append(bb->ips, (gchar *) rd->ip);
}
}
--- a/libpurple/protocols/zephyr/zephyr.c Tue Jan 12 00:28:54 2021 -0600
+++ b/libpurple/protocols/zephyr/zephyr.c Wed Jan 13 04:35:22 2021 -0600
@@ -1047,13 +1047,13 @@
if (buff[0]) {
triple = g_strsplit(buff, ",", 3);
if (triple[0] && triple[1]) {
- char *tmp = g_strdup_printf("%s", zephyr->username);
+ char *tmp = g_strdup(zephyr->username);
char *atptr;
if (triple[2] == NULL) {
recip = g_malloc0(1);
} else if (!g_ascii_strcasecmp(triple[2], "%me%")) {
- recip = g_strdup_printf("%s", zephyr->username);
+ recip = g_strdup(zephyr->username);
} else if (!g_ascii_strcasecmp(triple[2], "*")) {
/* wildcard
* form of class,instance,* */
@@ -1814,16 +1814,10 @@
char *local_zephyr_normalize(zephyr_account *zephyr,const char *orig)
{
- /*
- Basically the inverse of zephyr_strip_local_realm
- */
-
- if (!g_ascii_strcasecmp(orig, "")) {
- return g_strdup("");
- }
-
- if (strchr(orig, '@')) {
- return g_strdup_printf("%s", orig);
+ /* Basically the inverse of zephyr_strip_local_realm */
+
+ if (*orig == '\0' || strchr(orig, '@')) {
+ return g_strdup(orig);
}
return g_strdup_printf("%s@%s", orig, zephyr->realm);
--- a/pidgin/plugins/disco/gtkdisco.c Tue Jan 12 00:28:54 2021 -0600
+++ b/pidgin/plugins/disco/gtkdisco.c Wed Jan 13 04:35:22 2021 -0600
@@ -221,7 +221,7 @@
at = strchr(username, '@');
slash = strchr(username, '/');
if (at && !slash) {
- server = g_strdup_printf("%s", at + 1);
+ server = g_strdup(at + 1);
} else if (at && slash && at + 1 < slash) {
server = g_strdup_printf("%.*s", (int)(slash - (at + 1)), at + 1);
}