diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 001acb6f3..c898cd787 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -178,7 +178,7 @@ POSSIBILITY OF SUCH DAMAGE. #else // this is the maximum number of characters in a // path element / filename on windows -#define NAME_MAX 255 +#define TORRENT_MAX_PATH 255 #warning unknown platform, assuming the longest path is 255 #endif diff --git a/src/escape_string.cpp b/src/escape_string.cpp index a57473a82..8fd2074cb 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -268,7 +268,7 @@ namespace libtorrent if (!need_encoding(path.c_str(), path.size())) return url; - char msg[NAME_MAX*4]; + char msg[TORRENT_MAX_PATH*4]; snprintf(msg, sizeof(msg), "%s://%s%s%s:%d%s", protocol.c_str(), auth.c_str() , auth.empty()?"":"@", host.c_str(), port , escape_path(path.c_str(), path.size()).c_str());