diff --git a/src/hidapi/mac/hid.c b/src/hidapi/mac/hid.c index e8c0d09945..c6541682c5 100644 --- a/src/hidapi/mac/hid.c +++ b/src/hidapi/mac/hid.c @@ -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);