From: Uwe Hermann Date: Wed, 18 Mar 2015 22:08:26 +0000 (+0100) Subject: fx2lafw: Replace obsoleted strncmp() calls. X-Git-Tag: libsigrok-0.4.0~601 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bc497772512c2fd37516964ade58b69448aae37c;p=libsigrok.git 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. --- diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index bd0d4fb8..fae80b72 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -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;