From f123e55fa94c7ae1208143d79c3fd0ba3ee6e2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Thu, 22 Jun 2017 16:22:11 +0200 Subject: [PATCH] Fix assertion condition. --- source/vibe/core/path.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/vibe/core/path.d b/source/vibe/core/path.d index 58621e4..33fbeef 100644 --- a/source/vibe/core/path.d +++ b/source/vibe/core/path.d @@ -1249,7 +1249,7 @@ struct InetPathFormat { for (size_t i = idx; i < s.length; i++) { if (s[i] == '%') { - assert(i+3 < s.length, "segment string not validated!?"); + assert(i+2 < s.length, "segment string not validated!?"); ret.put(cast(char)(hexDigit(s[i+1]) << 4 | hexDigit(s[i+2]))); i += 2; } else ret.put(s[i]); @@ -1270,5 +1270,6 @@ struct InetPathFormat { assert(decodeSegment!Segment("foo").equal([Segment("foo")])); assert(decodeSegment!Segment("foo/").equal([Segment("foo", '/')])); assert(decodeSegment!Segment("fo%20o\\").equal([Segment("fo o\\")])); + assert(decodeSegment!Segment("foo%20").equal([Segment("foo ")])); } }