Make monitor and joystick names static strings

Related to #478.
This commit is contained in:
Camilla Löwy
2021-05-13 17:32:31 +02:00
parent a39115a27b
commit da236ba807
5 changed files with 10 additions and 15 deletions
+1 -3
View File
@@ -170,8 +170,7 @@ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM)
monitor->widthMM = widthMM;
monitor->heightMM = heightMM;
if (name)
monitor->name = _glfw_strdup(name);
strncpy(monitor->name, name, sizeof(monitor->name) - 1);
return monitor;
}
@@ -189,7 +188,6 @@ void _glfwFreeMonitor(_GLFWmonitor* monitor)
_glfwFreeGammaArrays(&monitor->currentRamp);
free(monitor->modes);
free(monitor->name);
free(monitor);
}