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
This commit is contained in:
Max Kellermann 2008-03-26 10:37:27 +00:00 committed by Eric Wong
parent b546bcfec6
commit 54b544c2f4
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ static int myShout_initDriver(AudioOutput * audioOutput, ConfigParam * param)
/* optional paramters */
blockParam = getBlockParam(param, "timeout");
if (blockParam) {
sd->timeout = strtod(blockParam->value, &test);
sd->timeout = (int)strtol(blockParam->value, &test, 10);
if (*test != '\0' || sd->timeout <= 0) {
FATAL("shout timeout is not a positive integer, "
"line %i\n", blockParam->line);