Replaced manual duplication with strdup.

master
Camilla Berglund ago%!(EXTRA string=13 years)
parent 73622a2f3c
commit e188f6c4e1
  1. 4
      src/x11_monitor.c

@ -53,9 +53,7 @@ _GLFWmonitor** _glfwCreateMonitor(_GLFWmonitor** current,
(*current)->physicalWidth = outputInfo->mm_width;
(*current)->physicalHeight = outputInfo->mm_height;
(*current)->name = malloc(strlen(outputInfo->name) + 1);
memcpy((*current)->name, outputInfo->name, strlen(outputInfo->name) + 1);
(*current)->name[strlen(outputInfo->name)] = '\0';
(*current)->name = strdup(outputInfo->name);
(*current)->screenX = crtcInfo->x;
(*current)->screenY = crtcInfo->y;

Loading…
Cancel
Save