From d4fe37aef1de7655b8f15e7c155056096b840209 Mon Sep 17 00:00:00 2001 From: Stefan Gehn Date: Sun, 23 Nov 2014 22:00:28 +0100 Subject: [PATCH] Fix crashing system name display on unknown Windows version The calling GKrellM code always expects a system name that can be split at the first space character to provide kernel name and kernel version. Return a string containing a space to avoid a crash on any Windows version the code does not know about (or in case querying the version failed). --- src/sysdeps/win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysdeps/win32.c b/src/sysdeps/win32.c index 21397e5..4afcfbd 100644 --- a/src/sysdeps/win32.c +++ b/src/sysdeps/win32.c @@ -1895,7 +1895,7 @@ gchar *gkrellm_sys_get_system_name(void) gkrellm_debug(DEBUG_SYSDEP, "Retrieving system name\n"); // Default value for sysname - g_strlcpy(sysname, "Unknown", sizeof(sysname)); + g_strlcpy(sysname, "Windows Unknown", sizeof(sysname)); // Query version info memset(&vi, 0, sizeof(OSVERSIONINFOEXW));