Skip to content

Commit

Permalink
hidapi/mac: replace sprintf uses with snprintf.
Browse files Browse the repository at this point in the history
Reference issues:
-  libusb/hidapi#509
-  libusb/hidapi#511

(cherry picked from commit ae9119c)
  • Loading branch information
sezero authored and slouken committed Apr 24, 2023
1 parent 5f344c1 commit 0f2322a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hidapi/mac/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)

/* Create the Run Loop Mode for this device.
printing the reference seems to work. */
sprintf(str, "HIDAPI_%p", os_dev);
snprintf(str, sizeof(str), "HIDAPI_%p", os_dev);
dev->run_loop_mode =
CFStringCreateWithCString(NULL, str, kCFStringEncodingASCII);

Expand Down

0 comments on commit 0f2322a

Please sign in to comment.