Commit bcc3a9de authored by Max Kellermann's avatar Max Kellermann

shout: use config_get_block_unsigned()

Eliminated manual integer parsing.
parent 710a61a3
...@@ -101,7 +101,7 @@ my_shout_init_driver(const struct audio_format *audio_format, ...@@ -101,7 +101,7 @@ my_shout_init_driver(const struct audio_format *audio_format,
{ {
struct shout_data *sd; struct shout_data *sd;
char *test; char *test;
int port; unsigned port;
char *host; char *host;
char *mount; char *mount;
char *passwd; char *passwd;
...@@ -129,11 +129,8 @@ my_shout_init_driver(const struct audio_format *audio_format, ...@@ -129,11 +129,8 @@ my_shout_init_driver(const struct audio_format *audio_format,
check_block_param("mount"); check_block_param("mount");
mount = block_param->value; mount = block_param->value;
check_block_param("port"); port = config_get_block_unsigned(param, "port", 0);
if (port == 0) {
port = strtol(block_param->value, &test, 10);
if (*test != '\0' || port <= 0) {
g_error("shout port \"%s\" is not a positive integer, line %i\n", g_error("shout port \"%s\" is not a positive integer, line %i\n",
block_param->value, block_param->line); block_param->value, block_param->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