Skip to content

Fix deviceid test when model present but no vendor #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
  • Loading branch information
doismellburning committed Jul 16, 2025
commit 81abac632493c9c52bf6f8f942bf32418a437f62
5 changes: 5 additions & 0 deletions src/deviceid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down