File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1081,7 +1081,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_manufacturer_string(hid_device *dev
10811081 }
10821082
10831083 wcsncpy (string , dev -> device_info -> manufacturer_string , maxlen );
1084- string [maxlen ] = L'\0' ;
1084+ string [maxlen - 1 ] = L'\0' ;
10851085
10861086 return 0 ;
10871087}
@@ -1102,7 +1102,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wch
11021102
11031103
11041104 wcsncpy (string , dev -> device_info -> product_string , maxlen );
1105- string [maxlen ] = L'\0' ;
1105+ string [maxlen - 1 ] = L'\0' ;
11061106
11071107 return 0 ;
11081108}
@@ -1123,7 +1123,7 @@ int HID_API_EXPORT_CALL HID_API_CALL hid_get_serial_number_string(hid_device *de
11231123
11241124
11251125 wcsncpy (string , dev -> device_info -> serial_number , maxlen );
1126- string [maxlen ] = L'\0' ;
1126+ string [maxlen - 1 ] = L'\0' ;
11271127
11281128 return 0 ;
11291129}
You can’t perform that action at this time.
0 commit comments