From e118e958f7f9b87054679ebf6102d6923abbba81 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 11 Aug 2015 22:57:06 +0200 Subject: protocol/ArgParser: add overload with max_value parameter --- src/command/QueueCommands.cxx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/command/QueueCommands.cxx') diff --git a/src/command/QueueCommands.cxx b/src/command/QueueCommands.cxx index 634510cc8..9a64ceb25 100644 --- a/src/command/QueueCommands.cxx +++ b/src/command/QueueCommands.cxx @@ -314,15 +314,9 @@ handle_prio(Client &client, Request args) { const char *const priority_string = args.shift(); unsigned priority; - if (!ParseCommandArg(client, priority, priority_string)) + if (!ParseCommandArg(client, priority, priority_string, 0xff)) return CommandResult::ERROR; - if (priority > 0xff) { - command_error(client, ACK_ERROR_ARG, - "Priority out of range: %s", priority_string); - return CommandResult::ERROR; - } - for (const char *i : args) { RangeArg range; if (!ParseCommandArg(client, range, i)) @@ -344,15 +338,9 @@ handle_prioid(Client &client, Request args) { const char *const priority_string = args.shift(); unsigned priority; - if (!ParseCommandArg(client, priority, priority_string)) + if (!ParseCommandArg(client, priority, priority_string, 0xff)) return CommandResult::ERROR; - if (priority > 0xff) { - command_error(client, ACK_ERROR_ARG, - "Priority out of range: %s", priority_string); - return CommandResult::ERROR; - } - for (const char *i : args) { unsigned song_id; if (!ParseCommandArg(client, song_id, i)) -- cgit v1.2.3