Skip to content

Commit

Permalink
dfu,ftdipp_mpsse: sprintf -> snprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwenhael Goavec authored and Gwenhael Goavec committed Feb 20, 2024
1 parent 3165552 commit 0182d59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dfu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ int DFU::searchDFUDevices()
}
} else if (_debug) {
char mess[256];
sprintf(mess,"Unable to open device: "
snprintf(mess, 256, "Unable to open device: "
"%04x:%04x (bus %d, device %2d) Error: %s -> skip\n",
desc.idVendor, desc.idProduct,
libusb_get_bus_number(usb_dev),
Expand Down
2 changes: 1 addition & 1 deletion src/ftdipp_mpsse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ bool FTDIpp_MPSSE::search_with_dev(const string &device)
usbdeviceparent, "busnum"), 10));
_addr = static_cast<uint8_t>(udevstufftoint(udev_device_get_sysattr_value(
usbdeviceparent, "devnum"), 10));
sprintf(_product, "%s", udev_device_get_sysattr_value(usbdeviceparent, "product"));
snprintf(_product, 64, "%s", udev_device_get_sysattr_value(usbdeviceparent, "product"));
_vid = udevstufftoint(
udev_device_get_sysattr_value(usbdeviceparent, "idVendor"), 16);
_pid = udevstufftoint(udev_device_get_sysattr_value(
Expand Down

0 comments on commit 0182d59

Please sign in to comment.