Commit 54b544c2 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

parse/initialize with the correct data type

When we expect an integer as result, why would we use the double precision floating point parser? strtol() is a better match, although we should probably check for overflows... git-svn-id: https://svn.musicpd.org/mpd/trunk@7198 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent b546bcfe
...@@ -218,7 +218,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param) ...@@ -218,7 +218,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
/* optional paramters */ /* optional paramters */
blockParam = getBlockParam(param, "timeout"); blockParam = getBlockParam(param, "timeout");
if (blockParam) { if (blockParam) {
sd->timeout = strtod(blockParam->value, &test); sd->timeout = (int)strtol(blockParam->value, &test, 10);
if (*test != '\0' || sd->timeout <= 0) { if (*test != '\0' || sd->timeout <= 0) {
FATAL("shout timeout is not a positive integer, " FATAL("shout timeout is not a positive integer, "
"line %i\n", blockParam->line); "line %i\n", blockParam->line);
......
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