Fix compile warning.

This commit is contained in:
wb2osz 2024-10-18 23:52:24 +01:00
parent e1e5be36e0
commit a627abc484
1 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,8 @@
https://github.com/libusb/hidapi . https://github.com/libusb/hidapi .
********************************************************/ ********************************************************/
#include "../../src/direwolf.h" // for strlcpy
#include <windows.h> #include <windows.h>
#ifndef _NTDEF_ #ifndef _NTDEF_
@ -465,7 +467,8 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
if (str) { if (str) {
len = strlen(str); len = strlen(str);
cur_dev->path = (char*) calloc(len+1, sizeof(char)); 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'; cur_dev->path[len] = '\0';
} }
else else