diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-01-21 09:17:11 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-01-21 09:17:11 +0100 |
commit | 05fdb2929fca26ba2057ecb781817a79a46ed9b8 (patch) | |
tree | 91ab607f691b5938e5a63e2d4f91054a58617961 /tests/unit | |
parent | d5b61f565e693d184e09b2900ea7dc4f8d725d91 (diff) | |
download | weechat-05fdb2929fca26ba2057ecb781817a79a46ed9b8.zip |
tests: add missing format string in calls to snprintf
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/plugins/irc/test-irc-info.cpp | 2 | ||||
-rw-r--r-- | tests/unit/plugins/test-plugin-api-info.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/plugins/irc/test-irc-info.cpp b/tests/unit/plugins/irc/test-irc-info.cpp index 13035f544..117c5f851 100644 --- a/tests/unit/plugins/irc/test-irc-info.cpp +++ b/tests/unit/plugins/irc/test-irc-info.cpp @@ -198,7 +198,7 @@ TEST(IrcInfo, InfoIrcNickColorCb) WEE_TEST_STR(NULL, hook_info_get (NULL, "irc_nick_color_name", NULL)); WEE_TEST_STR(NULL, hook_info_get (NULL, "irc_nick_color_name", "")); - snprintf (str_color, sizeof (str_color), gui_color_get_custom ("186")); + snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("186")); WEE_TEST_STR(str_color, hook_info_get (NULL, "irc_nick_color", "Nick")); WEE_TEST_STR("186", hook_info_get (NULL, "irc_nick_color_name", "Nick")); } diff --git a/tests/unit/plugins/test-plugin-api-info.cpp b/tests/unit/plugins/test-plugin-api-info.cpp index cf5b11f9d..0915bc0a6 100644 --- a/tests/unit/plugins/test-plugin-api-info.cpp +++ b/tests/unit/plugins/test-plugin-api-info.cpp @@ -558,14 +558,14 @@ TEST(PluginApiInfo, NickColor) char *str, str_color[64]; WEE_TEST_STR("186", hook_info_get (NULL, "nick_color_name", "Nick")); - snprintf (str_color, sizeof (str_color), gui_color_get_custom ("186")); + snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("186")); WEE_TEST_STR(str_color, hook_info_get (NULL, "nick_color", "Nick")); WEE_TEST_STR("blue", hook_info_get (NULL, "nick_color_name", "Nick;green,blue,red,yellow,cyan,magenta")); - snprintf (str_color, sizeof (str_color), gui_color_get_custom ("blue")); + snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("blue")); WEE_TEST_STR(str_color, hook_info_get (NULL, "nick_color", @@ -574,14 +574,14 @@ TEST(PluginApiInfo, NickColor) WEE_TEST_STR("212", hook_info_get (NULL, "nick_color_name_ignore_case", "Nick;26")); - snprintf (str_color, sizeof (str_color), gui_color_get_custom ("212")); + snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("212")); WEE_TEST_STR(str_color, hook_info_get (NULL, "nick_color_ignore_case", "Nick;26")); WEE_TEST_STR("green", hook_info_get (NULL, "nick_color_name_ignore_case", "Nick;26;green,blue,red,yellow,cyan,magenta")); - snprintf (str_color, sizeof (str_color), gui_color_get_custom ("green")); + snprintf (str_color, sizeof (str_color), "%s", gui_color_get_custom ("green")); WEE_TEST_STR(str_color, hook_info_get (NULL, "nick_color_ignore_case", |