mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 05:22:00 +00:00
Fix Coverity Scan false positive
This commit is contained in:
parent
621ece63c8
commit
c20754c4a6
@ -464,7 +464,7 @@ void _glfwPlatformUpdateGamepadGUID(char* guid)
|
|||||||
(strncmp(guid + 20, "000000000000", 12) == 0))
|
(strncmp(guid + 20, "000000000000", 12) == 0))
|
||||||
{
|
{
|
||||||
char original[33];
|
char original[33];
|
||||||
strcpy(original, guid);
|
strncpy(original, guid, sizeof(original) - 1);
|
||||||
sprintf(guid, "03000000%.4s0000%.4s000000000000",
|
sprintf(guid, "03000000%.4s0000%.4s000000000000",
|
||||||
original, original + 16);
|
original, original + 16);
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,7 @@ _GLFWjoystick* _glfwAllocJoystick(const char* name,
|
|||||||
js->buttonCount = buttonCount;
|
js->buttonCount = buttonCount;
|
||||||
js->hatCount = hatCount;
|
js->hatCount = hatCount;
|
||||||
|
|
||||||
strcpy(js->guid, guid);
|
strncpy(js->guid, guid, sizeof(js->guid) - 1);
|
||||||
js->mapping = findValidMapping(js);
|
js->mapping = findValidMapping(js);
|
||||||
|
|
||||||
return js;
|
return js;
|
||||||
|
@ -745,7 +745,7 @@ void _glfwPlatformUpdateGamepadGUID(char* guid)
|
|||||||
if (strcmp(guid + 20, "504944564944") == 0)
|
if (strcmp(guid + 20, "504944564944") == 0)
|
||||||
{
|
{
|
||||||
char original[33];
|
char original[33];
|
||||||
strcpy(original, guid);
|
strncpy(original, guid, sizeof(original) - 1);
|
||||||
sprintf(guid, "03000000%.4s0000%.4s000000000000",
|
sprintf(guid, "03000000%.4s0000%.4s000000000000",
|
||||||
original, original + 4);
|
original, original + 4);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user