Skip to content

Commit 81abac6

Browse files
Fix deviceid test when model present but no vendor
Fixes small bug introduced in b26c5a4 Without this, the error message was appended to, and e.g. `device` could end up as "UNKNOWN vendor/modelAFilterX" instead of the expected "AFilterX"
1 parent 486b3cf commit 81abac6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/deviceid.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,11 @@ void deviceid_decode_dest (char *dest, char *device, size_t device_size)
551551
strlcat (device, " ", device_size);
552552
}
553553

554+
if (ptocalls[n].vendor == NULL && ptocalls[n].model != NULL) {
555+
// If we don't have a vendor, but do have a model, wipe the error message
556+
strlcpy (device, "", device_size);
557+
}
558+
554559
if (ptocalls[n].model != NULL) {
555560
strlcat (device, ptocalls[n].model, device_size);
556561
}

0 commit comments

Comments
 (0)