From d339f5bcd2cfaffb2e9e63fc856c0c1c7b7e9bfb Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 4 Dec 2016 11:34:19 +0100 Subject: [PATCH] [db] fixup --- src/db.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db.c b/src/db.c index c2da17ac..7f82a9da 100644 --- a/src/db.c +++ b/src/db.c @@ -4553,14 +4553,14 @@ db_queue_add_by_fileid(int id, char reshuffle, uint32_t item_id) static int queue_enum_start(struct query_params *query_params) { -#define Q_TMPL "SELECT * FROM queue WHERE %s ORDER BY %s;" +#define Q_TMPL "SELECT * FROM queue WHERE %s %s;" char *query; const char *orderby; int ret; query_params->stmt = NULL; - if (query_params) + if (query_params->sort) orderby = sort_clause[query_params->sort]; else orderby = sort_clause[S_POS];