Skip to content

Commit

Permalink
Don't suggest usb:vid:pid for serial ports where vid is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Sep 19, 2023
1 parent 8730fc1 commit 6694e98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/serialadapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static char **sa_list_specs(const SERPORT *sp, int n, int i) {
}
}

if(Pi == 0) { // No unique serial adapter, so maybe vid:pid[:sn] works?
if(Pi == 0 && sp[i].vid) { // No unique serial adapter, so maybe vid:pid[:sn] works?
if(sa_unique_by_ids(sp[i].vid, sp[i].pid, "", sp, n, i))
Plist[Pi++] = str_sprintf("usb:%04x:%04x", sp[i].vid, sp[i].pid);
else if(*sn && sa_unique_by_ids(sp[i].vid, sp[i].pid, sn, sp, n, i))
Expand Down

0 comments on commit 6694e98

Please sign in to comment.