aboutsummaryrefslogtreecommitdiffstats
path: root/src/input/CurlInputPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 09:48:31 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 09:48:31 +0200
commit8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521 (patch)
treebbbb131e9d7b092f2994e3536c156206a7b9bbaa /src/input/CurlInputPlugin.cxx
parent222dc8a239f7578cecdcb21523052140aa1192cf (diff)
downloadmpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.gz
mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.tar.xz
mpd-8f1ec1dfdf31d70561eb14ae89a2e6cf9291f521.zip
util/NumberParser: utilities for parsing numbers from ASCII strings
Diffstat (limited to 'src/input/CurlInputPlugin.cxx')
-rw-r--r--src/input/CurlInputPlugin.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input/CurlInputPlugin.cxx b/src/input/CurlInputPlugin.cxx
index 5a754b78d..f7ac88717 100644
--- a/src/input/CurlInputPlugin.cxx
+++ b/src/input/CurlInputPlugin.cxx
@@ -31,6 +31,7 @@
#include "IOThread.hxx"
#include "util/ASCII.hxx"
#include "util/CharUtil.hxx"
+#include "util/NumberParser.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@@ -50,7 +51,6 @@
#include <forward_list>
#include <curl/curl.h>
-#include <glib.h>
#if LIBCURL_VERSION_NUM < 0x071200
#error libcurl is too old
@@ -854,7 +854,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
memcpy(buffer, value, end - value);
buffer[end - value] = 0;
- c->base.size = c->base.offset + g_ascii_strtoull(buffer, nullptr, 10);
+ c->base.size = c->base.offset + ParseUint64(buffer);
} else if (StringEqualsCaseASCII(name, "content-type")) {
c->base.mime.assign(value, end);
} else if (StringEqualsCaseASCII(name, "icy-name") ||
@@ -877,7 +877,7 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
memcpy(buffer, value, end - value);
buffer[end - value] = 0;
- icy_metaint = g_ascii_strtoull(buffer, nullptr, 10);
+ icy_metaint = ParseUint64(buffer);
FormatDebug(curl_domain, "icy-metaint=%zu", icy_metaint);
if (icy_metaint > 0) {