From 00c79cd3b2307d9a6191b43cd21ec534793aa546 Mon Sep 17 00:00:00 2001 From: ws909 <37029098+ws909@users.noreply.github.com> Date: Thu, 9 Mar 2023 17:00:53 +0100 Subject: [PATCH] C90 is so old --- tests/animate-icon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/animate-icon.c b/tests/animate-icon.c index ced690eb..4bec3cc8 100644 --- a/tests/animate-icon.c +++ b/tests/animate-icon.c @@ -72,7 +72,7 @@ static void set_icon(GLFWwindow* window, int iconColor) double green = (cos(SPEED * time * M_PI * 1.5) + 1.0) / 2.0; double blue = (cos(SPEED * time * M_PI * 2.0) + 1.0) / 2.0; - unsigned char pixels[width * height * 4]; + unsigned char* pixels = malloc(width * height * 4); for (x = 0; x < width; ++x) { @@ -97,6 +97,8 @@ static void set_icon(GLFWwindow* window, int iconColor) glfwSetWindowIcon(0, 1, &image); glfwSetErrorCallback(error_callback); + + free(pixels); } static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)