From d4f50745356fd38e30100d50418b83db24755994 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Mon, 25 May 2020 15:42:52 +0200 Subject: [PATCH] Replace %m conversion specifier with %s and strerror() When compiling with `-Wall` and `-pedantic-errors`, gcc complains with ``` warning: ISO C does not support the '%m' gnu_printf format [-Wformat=] ``` because the `%m` conversion specifier is a GNU extension. Closes #1702. --- src/wl_window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wl_window.c b/src/wl_window.c index c8dde30a..26cb2ac1 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -142,8 +142,8 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (fd < 0) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Creating a buffer file for %d B failed: %m", - length); + "Wayland: Creating a buffer file for %d B failed: %s", + length, strerror(errno)); return NULL; } @@ -151,7 +151,7 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image) if (data == MAP_FAILED) { _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: mmap failed: %m"); + "Wayland: mmap failed: %s", strerror(errno)); close(fd); return NULL; }