From 59d38f876a22ef520c6b897a356e8fb8677481aa Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 7 Aug 2014 15:15:56 +0200 Subject: util/StringUtil: add StripRight() overload with "end" argument --- src/input/plugins/CurlInputPlugin.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/input/plugins') diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 4d7671cc2..a174fcca6 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -31,7 +31,7 @@ #include "event/Call.hxx" #include "IOThread.hxx" #include "util/ASCII.hxx" -#include "util/CharUtil.hxx" +#include "util/StringUtil.hxx" #include "util/NumberParser.hxx" #include "util/CircularBuffer.hxx" #include "util/HugeAllocator.hxx" @@ -661,11 +661,8 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream) /* strip the value */ - while (value < end && IsWhitespaceOrNull(*value)) - ++value; - - while (end > value && IsWhitespaceOrNull(end[-1])) - --end; + value = StripLeft(value, end); + end = StripRight(value, end); c.HeaderReceived(name, std::string(value, end)); return size; -- cgit v1.2.3