From 15af9633bfd3ed7e760c8447bdae5f8170cd5f83 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 17 May 2019 03:00:07 +0200 Subject: [PATCH] Fixed off-by-one bug in remove_html_tags(). --- src/uri.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/uri.cpp b/src/uri.cpp index dc53a54..71eea6c 100644 --- a/src/uri.cpp +++ b/src/uri.cpp @@ -118,6 +118,10 @@ const string URI::remove_html_tags(const string &html) size_t endpos = html.find('>', startpos); out += html.substr(pos, startpos - pos); pos = endpos; + if (pos != std::string::npos) + { + ++pos; + } } return out;