mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[hal] Replace strncpy with memcpy (#3539)
This commit is contained in:
@@ -302,7 +302,7 @@ char* HAL_GetJoystickName(int32_t joystickNum) {
|
||||
} else {
|
||||
size_t len = std::strlen(joystickDesc.name);
|
||||
char* name = static_cast<char*>(std::malloc(len + 1));
|
||||
std::strncpy(name, joystickDesc.name, len);
|
||||
std::memcpy(name, joystickDesc.name, len);
|
||||
name[len] = '\0';
|
||||
return name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user