summaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-02-09 20:27:00 +0100
committerMax Kellermann <max@musicpd.org>2018-02-09 22:54:22 +0100
commit0f8d223c7fcc7e61808716dbb740786b9d95a991 (patch)
tree5913e9aa1e3a90aff0778bf32a6e83161fdf09c0 /src/protocol
parent19a2885fd5174f65a17ccb20d2fc790269baea02 (diff)
protocol/ArgParser: move strtof()/strtod() switch to util/NumberParser.hxx
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/ArgParser.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/protocol/ArgParser.cxx b/src/protocol/ArgParser.cxx
index 2665270e6..47fdfa405 100644
--- a/src/protocol/ArgParser.cxx
+++ b/src/protocol/ArgParser.cxx
@@ -21,6 +21,7 @@
#include "ArgParser.hxx"
#include "Ack.hxx"
#include "Chrono.hxx"
+#include "util/NumberParser.hxx"
#include <stdlib.h>
@@ -151,12 +152,7 @@ float
ParseCommandArgFloat(const char *s)
{
char *endptr;
-#ifdef ANDROID
- /* strtof() requires API level 21 */
- auto value = strtod(s, &endptr);
-#else
- auto value = strtof(s, &endptr);
-#endif
+ auto value = ParseFloat(s, &endptr);
if (endptr == s || *endptr != 0)
throw FormatProtocolError(ACK_ERROR_ARG,
"Float expected: %s", s);