In usbhid_open(), correctly calculate the

offset for serial number matching.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1389 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2016-04-18 14:47:53 +00:00
parent 9ac840041b
commit 059fbf3f47
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2016-04-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* usb_hidapi.c (usbhid_open): Correctly calculate the
offset for serial number matching
2016-03-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2016-03-28 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #47550: Linux GPIO broken bug #47550: Linux GPIO broken

View File

@ -108,7 +108,9 @@ static int usbhid_open(char * port, union pinfo pinfo, union filedescriptor *fd)
{ {
avrdude_message(MSG_NOTICE, "%s: usbhid_open(): Found %ls, serno: %ls\n", avrdude_message(MSG_NOTICE, "%s: usbhid_open(): Found %ls, serno: %ls\n",
progname, walk->product_string, walk->serial_number); progname, walk->product_string, walk->serial_number);
if (wcscmp(walk->serial_number + serlen, wserno) == 0) size_t slen = wcslen(walk->serial_number);
if (slen >= serlen &&
wcscmp(walk->serial_number + slen - serlen, wserno) == 0)
{ {
/* found matching serial number */ /* found matching serial number */
break; break;