# HG changeset patch # User Elliott Sales de Andrade # Date 1667547173 18000 # Node ID c67c45d700063764124f00e598a14a858df74edb # Parent e0a90a0a5bb2d432dfc05e5ed31e88a83af9f18f Fix string size specifier in debug prints The `%*s` specifies the *width* of the string, but this was intended to specify the maximum number of characters (in case the `GBytes` was unterminated), which is `%.*s`. Testing Done: Compiled only, though I did write a small test program with `printf` to confirm that this worked the intended way. Reviewed at https://reviews.imfreedom.org/r/2023/ diff -r e0a90a0a5bb2 -r c67c45d70006 libpurple/protocols/gg/avatar.c --- a/libpurple/protocols/gg/avatar.c Fri Nov 04 00:47:21 2022 -0500 +++ b/libpurple/protocols/gg/avatar.c Fri Nov 04 02:32:53 2022 -0500 @@ -274,7 +274,7 @@ } buffer = g_bytes_get_data(response_body, &size); - purple_debug_info("gg", "ggp_avatar_own_sent: %*s", (int)size, buffer); + purple_debug_info("gg", "ggp_avatar_own_sent: %.*s", (int)size, buffer); g_bytes_unref(response_body); } diff -r e0a90a0a5bb2 -r c67c45d70006 libpurple/protocols/gg/pubdir-prpl.c --- a/libpurple/protocols/gg/pubdir-prpl.c Fri Nov 04 00:47:21 2022 -0500 +++ b/libpurple/protocols/gg/pubdir-prpl.c Fri Nov 04 02:32:53 2022 -0500 @@ -165,7 +165,7 @@ xml_raw = g_bytes_unref_to_data(response_body, &xml_size); if (purple_debug_is_verbose() && purple_debug_is_unsafe()) { - purple_debug_misc("gg", "ggp_pubdir_got_data: xml=[%*s]", + purple_debug_misc("gg", "ggp_pubdir_got_data: xml=[%.*s]", (int)xml_size, xml_raw); } @@ -806,7 +806,7 @@ } buffer = g_bytes_get_data(response_body, &size); - purple_debug_info("gg", "ggp_pubdir_set_info_got_response: [%*s]", + purple_debug_info("gg", "ggp_pubdir_set_info_got_response: [%.*s]", (int)size, buffer); /* 0 */ diff -r e0a90a0a5bb2 -r c67c45d70006 libpurple/protocols/jabber/bosh.c --- a/libpurple/protocols/jabber/bosh.c Fri Nov 04 00:47:21 2022 -0500 +++ b/libpurple/protocols/jabber/bosh.c Fri Nov 04 02:32:53 2022 -0500 @@ -246,7 +246,7 @@ gsize length = 0; body = g_bytes_get_data(response_body, &length); - purple_debug_misc("jabber-bosh", "received: %*s", (int)length, body); + purple_debug_misc("jabber-bosh", "received: %.*s", (int)length, body); } node = jabber_bosh_connection_parse(bosh_conn, msg, response_body, error); @@ -430,7 +430,7 @@ gsize length = 0; body = g_bytes_get_data(response_body, &length); - purple_debug_misc("jabber-bosh", "received (session creation): %*s", + purple_debug_misc("jabber-bosh", "received (session creation): %.*s", (int)length, body); }