From dbaa37ea46775b38c635ff08c38991bdda65754d Mon Sep 17 00:00:00 2001 From: sh0f <30991096+sh0f@users.noreply.github.com> Date: Wed, 27 Nov 2019 17:15:05 +0800 Subject: [PATCH] urllib: fix string length in escape() --- vlib/net/urllib/urllib.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/net/urllib/urllib.v b/vlib/net/urllib/urllib.v index 6d132fb18f..89e0612aaa 100644 --- a/vlib/net/urllib/urllib.v +++ b/vlib/net/urllib/urllib.v @@ -277,7 +277,7 @@ fn escape(s string, mode EncodingMode) string { t[i] = `+` } } - return string(t) + return string(t, t.len) } upperhex := '0123456789ABCDEF' @@ -297,7 +297,7 @@ fn escape(s string, mode EncodingMode) string { j++ } } - return string(t) + return string(t, t.len) } // A URL represents a parsed URL (technically, a URI reference).