fx2lafw: Replace obsoleted strncmp() calls.

The fixed lengths for strncmp() can no longer be used since strings of
various lengths can be passed to match_manuf_prod(). Use strcmp() instead.
This commit is contained in:
Uwe Hermann 2015-03-18 23:08:26 +01:00
parent 6fcf3f0a22
commit bc49777251
1 changed files with 2 additions and 2 deletions

View File

@ -163,13 +163,13 @@ SR_PRIV gboolean match_manuf_prod(libusb_device *dev, const char *manufacturer,
if (libusb_get_string_descriptor_ascii(hdl,
des.iManufacturer, strdesc, sizeof(strdesc)) < 0)
break;
if (strncmp((const char *)strdesc, manufacturer, 6))
if (strcmp((const char *)strdesc, manufacturer))
break;
if (libusb_get_string_descriptor_ascii(hdl,
des.iProduct, strdesc, sizeof(strdesc)) < 0)
break;
if (strncmp((const char *)strdesc, product, 7))
if (strcmp((const char *)strdesc, product))
break;
ret = TRUE;