From c2efe87cffcb6509363a8b9d540a8958367a9c29 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 15 Feb 2016 08:34:44 +0100 Subject: [PATCH] Improve glfwinfo extension listing --- tests/glfwinfo.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c index ee70be83..e9037278 100644 --- a/tests/glfwinfo.c +++ b/tests/glfwinfo.c @@ -159,23 +159,27 @@ static void list_extensions(int api, int major, int minor) glGetIntegerv(GL_NUM_EXTENSIONS, &count); for (i = 0; i < count; i++) - puts((const char*) glGetStringi(GL_EXTENSIONS, i)); + printf(" %s\n", (const char*) glGetStringi(GL_EXTENSIONS, i)); } else { extensions = glGetString(GL_EXTENSIONS); while (*extensions != '\0') { - if (*extensions == ' ') - putchar('\n'); - else - putchar(*extensions); + putchar(' '); - extensions++; + while (*extensions != '\0' && *extensions != ' ') + { + putchar(*extensions); + extensions++; + } + + while (*extensions == ' ') + extensions++; + + putchar('\n'); } } - - putchar('\n'); } static int valid_version(void)