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).
This commit is contained in:
Stefan Gehn 2014-11-23 22:00:28 +01:00
parent 68a1dfd5f7
commit d4fe37aef1
1 changed files with 1 additions and 1 deletions

View File

@ -1895,7 +1895,7 @@ gchar *gkrellm_sys_get_system_name(void)
gkrellm_debug(DEBUG_SYSDEP, "Retrieving system name\n"); gkrellm_debug(DEBUG_SYSDEP, "Retrieving system name\n");
// Default value for sysname // Default value for sysname
g_strlcpy(sysname, "Unknown", sizeof(sysname)); g_strlcpy(sysname, "Windows Unknown", sizeof(sysname));
// Query version info // Query version info
memset(&vi, 0, sizeof(OSVERSIONINFOEXW)); memset(&vi, 0, sizeof(OSVERSIONINFOEXW));