mirror of
https://github.com/glfw/glfw.git
synced 2024-11-23 10:35:10 +00:00
Replaced manual duplication with strdup.
This commit is contained in:
parent
73622a2f3c
commit
e188f6c4e1
@ -53,9 +53,7 @@ _GLFWmonitor** _glfwCreateMonitor(_GLFWmonitor** current,
|
|||||||
(*current)->physicalWidth = outputInfo->mm_width;
|
(*current)->physicalWidth = outputInfo->mm_width;
|
||||||
(*current)->physicalHeight = outputInfo->mm_height;
|
(*current)->physicalHeight = outputInfo->mm_height;
|
||||||
|
|
||||||
(*current)->name = malloc(strlen(outputInfo->name) + 1);
|
(*current)->name = strdup(outputInfo->name);
|
||||||
memcpy((*current)->name, outputInfo->name, strlen(outputInfo->name) + 1);
|
|
||||||
(*current)->name[strlen(outputInfo->name)] = '\0';
|
|
||||||
|
|
||||||
(*current)->screenX = crtcInfo->x;
|
(*current)->screenX = crtcInfo->x;
|
||||||
(*current)->screenY = crtcInfo->y;
|
(*current)->screenY = crtcInfo->y;
|
||||||
|
Loading…
Reference in New Issue
Block a user