From bd5e2d9fc5c1a4b61992436c868882aed5e1b860 Mon Sep 17 00:00:00 2001 From: stickz Date: Mon, 13 Jan 2025 11:03:03 -0500 Subject: [PATCH] libtorrent: Fix compile warning with udp_tracker_info ``` ../../rak/udp_tracker_info.h: In member function 'rak::udp_tracker_info rak::udp_tracker_vector::create_info(std::string)': ../../rak/udp_tracker_info.h:55:43: warning: format '%[^:' expects argument of type 'char*', but argument 3 has type 'char (*)[1024]' [-Wformat=] 55 | if (sscanf(url.c_str(), "udp://%1023[^:]:%i/announce", &hostname, &port) == 2 && hostname[0] != '\0' && port > 0 && port < (1 << 16)) { | ~~~~~~~^ ~~~~~~~~~ | | | | char* char (*)[1024] ``` --- libtorrent/rak/udp_tracker_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtorrent/rak/udp_tracker_info.h b/libtorrent/rak/udp_tracker_info.h index 47a123fd..91b4b406 100644 --- a/libtorrent/rak/udp_tracker_info.h +++ b/libtorrent/rak/udp_tracker_info.h @@ -52,7 +52,7 @@ class udp_tracker_vector : public std::vector { int port; udp_tracker_info new_info; - if (sscanf(url.c_str(), "udp://%1023[^:]:%i/announce", &hostname, &port) == 2 && hostname[0] != '\0' && port > 0 && port < (1 << 16)) { + if (sscanf(url.c_str(), "udp://%1023[^:]:%i/announce", hostname, &port) == 2 && hostname[0] != '\0' && port > 0 && port < (1 << 16)) { new_info.set(url, hostname, port); base_type::push_back(new_info); return new_info;