From 96c2d04b11d25ce0372a9df562264e5c76b830a3 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 9 Sep 2010 19:36:40 +0200 Subject: [PATCH] Formatting, added comment. --- tests/events.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/events.c b/tests/events.c index 1472d980..9afb9e59 100644 --- a/tests/events.c +++ b/tests/events.c @@ -152,14 +152,15 @@ static const char* get_button_name(int button) static const char* get_character_string(int character) { - static char result[6 + 1]; + // This assumes UTF-8, which is stupid + static char result[6 + 1]; - int length = wctomb(result, character); - if (length == -1) - length = 0; + int length = wctomb(result, character); + if (length == -1) + length = 0; - result[length] = '\0'; - return result; + result[length] = '\0'; + return result; } static void window_size_callback(GLFWwindow window, int width, int height)