aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-26 19:34:00 +0100
committerMax Kellermann <max@duempel.org>2009-02-26 19:34:00 +0100
commitbcc3a9debfc60e7c18fe70388482ed697962eb80 (patch)
tree3a8b02e91d5c2a9be421ca254eaa6b6be6e48ed3 /src/output
parent710a61a3dc2603f4ac63915c0fcce6a278fdce4c (diff)
downloadmpd-bcc3a9debfc60e7c18fe70388482ed697962eb80.tar.gz
mpd-bcc3a9debfc60e7c18fe70388482ed697962eb80.tar.xz
mpd-bcc3a9debfc60e7c18fe70388482ed697962eb80.zip
shout: use config_get_block_unsigned()
Eliminated manual integer parsing.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/shout_plugin.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c
index 61f8aeea4..2a8f2f189 100644
--- a/src/output/shout_plugin.c
+++ b/src/output/shout_plugin.c
@@ -101,7 +101,7 @@ my_shout_init_driver(const struct audio_format *audio_format,
{
struct shout_data *sd;
char *test;
- int port;
+ unsigned port;
char *host;
char *mount;
char *passwd;
@@ -129,11 +129,8 @@ my_shout_init_driver(const struct audio_format *audio_format,
check_block_param("mount");
mount = block_param->value;
- check_block_param("port");
-
- port = strtol(block_param->value, &test, 10);
-
- if (*test != '\0' || port <= 0) {
+ port = config_get_block_unsigned(param, "port", 0);
+ if (port == 0) {
g_error("shout port \"%s\" is not a positive integer, line %i\n",
block_param->value, block_param->line);
}