From a28baabefe7f0a50c2017f57347e9a543865f1a8 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 16 Oct 2016 13:35:23 +0100 Subject: [PATCH] Allow a monitor to be created without a name. --- src/monitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/monitor.c b/src/monitor.c index df32a3c4..dcb9796a 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -175,10 +175,12 @@ void _glfwInputMonitorWindowChange(_GLFWmonitor* monitor, _GLFWwindow* window) _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) { _GLFWmonitor* monitor = calloc(1, sizeof(_GLFWmonitor)); - monitor->name = strdup(name); monitor->widthMM = widthMM; monitor->heightMM = heightMM; + if (name) + monitor->name = strdup(name); + return monitor; }