]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Small logic fix 768/head
authorTill Zimmermann <tillz@tillz.net>
Sat, 3 Nov 2018 13:34:12 +0000 (14:34 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Nov 2018 13:34:12 +0000 (14:34 +0100)
Fixes #767

mqtt.c

diff --git a/mqtt.c b/mqtt.c
index 6d160e810f84531b22dbee9d8ea2cb9a2a117683..520e17d488f28b1f613add161f12ae96f4b2ff10 100644 (file)
--- 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++;
   }
 }