From 736d19f924abb8eaa95bb3ea2c85e2049575a74d Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 31 Aug 2013 11:03:15 +0200 Subject: [PATCH] Fix error in c897761ee330e3c62d041c837abbb6f9b3b19b7c Changed the way it's detected if speaker id is hex or dec --- src/httpd_dacp.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 8f347e9a..65710c4e 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1513,16 +1513,21 @@ dacp_reply_setspeakers(struct evhttp_request *req, struct evbuffer *evbuf, char { param++; /* Hyperfine Remote for Android will send in decimal, others use hex */ - if (safe_atou64(param, &ids[i]) < 0) - { - ret = safe_hextou64(param, &ids[i]); - if (ret < 0) - { - DPRINTF(E_LOG, L_DACP, "Invalid speaker id in request: %s\n", param); + if ((strlen(param) > 1) && (param[1] != 'x')) + ret = safe_atou64(param, &ids[i]); + else + ret = safe_hextou64(param, &ids[i]); - nspk--; - continue; - } + if (ret < 0) + { + DPRINTF(E_LOG, L_DACP, "Invalid speaker id in request: %s\n", param); + + nspk--; + continue; + } + else + { + DPRINTF(E_DBG, L_DACP, "Speaker id converted with ret %d, param %s, dec val %llu.\n", ret, param, ids[i]); } i++; }