From a627abc4849714ea3ee47085ab935dadaf8a867b Mon Sep 17 00:00:00 2001 From: wb2osz Date: Fri, 18 Oct 2024 23:52:24 +0100 Subject: [PATCH] Fix compile warning. --- external/hidapi/hid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/external/hidapi/hid.c b/external/hidapi/hid.c index e483cd4..f5c9858 100644 --- a/external/hidapi/hid.c +++ b/external/hidapi/hid.c @@ -20,6 +20,8 @@ https://github.com/libusb/hidapi . ********************************************************/ +#include "../../src/direwolf.h" // for strlcpy + #include #ifndef _NTDEF_ @@ -465,7 +467,8 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor if (str) { len = strlen(str); cur_dev->path = (char*) calloc(len+1, sizeof(char)); - strncpy(cur_dev->path, str, len+1); + //strncpy(cur_dev->path, str, len+1); // produces warning + strlcpy(cur_dev->path, str, len+1); cur_dev->path[len] = '\0'; } else