Skip to content

Commit

Permalink
libtorrent: Fix compile warning with udp_tracker_info
Browse files Browse the repository at this point in the history
```
../../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]
```
  • Loading branch information
stickz committed Jan 13, 2025
1 parent cbc169f commit bd5e2d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libtorrent/rak/udp_tracker_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class udp_tracker_vector : public std::vector<udp_tracker_info> {
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;
Expand Down

0 comments on commit bd5e2d9

Please sign in to comment.