From 9d2ab20fc189dc3eea20e9b33f91e44a76b21d95 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 24 Sep 2017 17:13:32 -0400 Subject: [PATCH] src: remove unused computation PR-URL: https://github.com/nodejs/node/pull/15593 Reviewed-By: Anna Henningsen Reviewed-By: Timothy Gu Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- src/node_url.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index 3b5dbe1653deda..04254667d6d824 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -515,10 +515,10 @@ static inline void PercentDecode(const char* input, dest->reserve(len); const char* pointer = input; const char* end = input + len; - size_t remaining = pointer - end - 1; + while (pointer < end) { const char ch = pointer[0]; - remaining = (end - pointer) + 1; + size_t remaining = (end - pointer) + 1; if (ch != '%' || remaining < 2 || (ch == '%' && (!IsASCIIHexDigit(pointer[1]) ||