From b38c3fa1bbd67bcae1718fc9fe0cb42a9a5d1f6c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 30 Jul 2006 05:00:56 +0000 Subject: command: fix find/search commands from the malloc reduction patch The most we ever use is for search/find, and that limits it to the number of tags we can have. Add one for the command, and one extra to catch errors clients may send us. Thanks to Qball for reporting this bug git-svn-id: https://svn.musicpd.org/mpd/trunk@4486 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/command.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/command.c b/src/command.c index 53ed8de90..b56956e74 100644 --- a/src/command.c +++ b/src/command.c @@ -29,6 +29,7 @@ #include "buffer2array.h" #include "log.h" #include "dbUtils.h" +#include "tag.h" #include #include @@ -104,10 +105,12 @@ #define COMMAND_STATUS_AUDIO "audio" #define COMMAND_STATUS_UPDATING_DB "updating_db" -/* the most we ever use is argv[2], so argv[] has (at most) - * 3 usable elements. This means we tokenize up to 4 elements to - * detect errors clients may send us */ -#define COMMAND_ARGV_MAX 4 +/* + * The most we ever use is for search/find, and that limits it to the + * number of tags we can have. Add one for the command, and one extra + * to catch errors clients may send us + */ +#define COMMAND_ARGV_MAX (2+(TAG_NUM_OF_ITEM_TYPES*2)) typedef struct _CommandEntry CommandEntry; -- cgit v1.2.3