From 81abac632493c9c52bf6f8f942bf32418a437f62 Mon Sep 17 00:00:00 2001 From: Kristian Glass Date: Wed, 16 Jul 2025 23:53:24 +0100 Subject: [PATCH] Fix deviceid test when model present but no vendor Fixes small bug introduced in b26c5a4d7d4b2fd19160a1ff20cece13b2c18b13 Without this, the error message was appended to, and e.g. `device` could end up as "UNKNOWN vendor/modelAFilterX" instead of the expected "AFilterX" --- src/deviceid.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/deviceid.c b/src/deviceid.c index 49b9b346..7db2997c 100644 --- a/src/deviceid.c +++ b/src/deviceid.c @@ -551,6 +551,11 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size) strlcat (device, " ", device_size); } + if (ptocalls[n].vendor == NULL && ptocalls[n].model != NULL) { + // If we don't have a vendor, but do have a model, wipe the error message + strlcpy (device, "", device_size); + } + if (ptocalls[n].model != NULL) { strlcat (device, ptocalls[n].model, device_size); }