From afaf6df46baa294cc9489f4bb45fa41c3b53374b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 6 Sep 2009 07:24:15 +0000 Subject: [PATCH] escape string fix --- src/escape_string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/escape_string.cpp b/src/escape_string.cpp index 34f192f67..a57473a82 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -205,7 +205,7 @@ namespace libtorrent std::string ret; for (int i = 0; i < len; ++i) { - if (std::strchr(unreserved_chars+offset, *str)) + if (std::strchr(unreserved_chars+offset, *str) && *str != 0) { ret += *str; } @@ -234,7 +234,7 @@ namespace libtorrent { for (int i = 0; i < len; ++i) { - if (std::strchr(unreserved_chars, *str) == 0) + if (std::strchr(unreserved_chars, *str) == 0 || *str == 0) return true; ++str; }