Commit 19a2885f authored by Max Kellermann's avatar Max Kellermann

protocol/ArgParser: use strtod() instead of strtof() on Android

For Android pre-5.0 compatibility (#213).
parent b8a09447
......@@ -151,7 +151,12 @@ 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
if (endptr == s || *endptr != 0)
throw FormatProtocolError(ACK_ERROR_ARG,
"Float expected: %s", s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment