From: Till Zimmermann Date: Sat, 3 Nov 2018 13:34:12 +0000 (+0100) Subject: Small logic fix X-Git-Tag: 3.3RC0~180^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F768%2Fhead;p=thirdparty%2Fshairport-sync.git Small logic fix Fixes #767 --- diff --git a/mqtt.c b/mqtt.c index 6d160e81..520e17d4 100644 --- a/mqtt.c +++ b/mqtt.c @@ -60,13 +60,14 @@ void on_message(__attribute__((unused)) struct mosquitto *mosq, int it = 0; // send command if it's a valid one - while (commands[it++] != NULL) { + while (commands[it] != NULL) { if ((size_t)msg->payloadlen >= strlen(commands[it]) && strncmp(msg->payload, commands[it], strlen(commands[it])) == 0) { debug(1, "[MQTT]: DACP Command: %s\n", commands[it]); send_simple_dacp_command(commands[it]); break; } + it++; } }