From 21a015778fca0c5f379894adc66ab2292c8f2891 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 2 Oct 2012 17:07:59 +0200 Subject: [PATCH] Replaced malloc and memset with calloc. --- src/window.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/window.c b/src/window.c index 0b6fb9bd..741938d1 100644 --- a/src/window.c +++ b/src/window.c @@ -308,15 +308,13 @@ GLFWAPI GLFWwindow glfwCreateWindow(int width, int height, height = 480; } - window = (_GLFWwindow*) malloc(sizeof(_GLFWwindow)); + window = (_GLFWwindow*) calloc(1, sizeof(_GLFWwindow)); if (!window) { _glfwSetError(GLFW_OUT_OF_MEMORY, NULL); return NULL; } - memset(window, 0, sizeof(_GLFWwindow)); - window->next = _glfwLibrary.windowListHead; _glfwLibrary.windowListHead = window;