From 282871eaba2b61dc56d6451509d78e9fd9351abd Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 8 Jul 2020 10:20:15 +0100 Subject: [PATCH] Remove leading zeroes from an incoming DACP ID in another place --- mdns_avahi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mdns_avahi.c b/mdns_avahi.c index f3c1f1c9..fcbbe484 100644 --- a/mdns_avahi.c +++ b/mdns_avahi.c @@ -152,6 +152,8 @@ static void browse_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, Avah char *dacpid = strstr(name, "iTunes_Ctrl_"); if (dacpid) { dacpid += strlen("iTunes_Ctrl_"); + while (*dacpid == '0') + dacpid++; // remove any leading zeroes if ((dbs->dacp_id) && (strcmp(dacpid, dbs->dacp_id) == 0)) dacp_monitor_port_update_callback(dbs->dacp_id, 0); // say the port is withdrawn } else {