Use strcpy_literal in more places

This commit is contained in:
twinaphex 2020-09-20 00:12:54 +02:00
parent 0e49f058f3
commit eefcd0e99f

View File

@ -330,36 +330,36 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
{
case 10:
if (server)
strlcpy(s, "Windows Server 2016", len);
strcpy_literal(s, "Windows Server 2016");
else
strlcpy(s, "Windows 10", len);
strcpy_literal(s, "Windows 10");
break;
case 6:
switch (vi.dwMinorVersion)
{
case 3:
if (server)
strlcpy(s, "Windows Server 2012 R2", len);
strcpy_literal(s, "Windows Server 2012 R2");
else
strlcpy(s, "Windows 8.1", len);
strcpy_literal(s, "Windows 8.1");
break;
case 2:
if (server)
strlcpy(s, "Windows Server 2012", len);
strcpy_literal(s, "Windows Server 2012");
else
strlcpy(s, "Windows 8", len);
strcpy_literal(s, "Windows 8");
break;
case 1:
if (server)
strlcpy(s, "Windows Server 2008 R2", len);
strcpy_literal(s, "Windows Server 2008 R2");
else
strlcpy(s, "Windows 7", len);
strcpy_literal(s, "Windows 7");
break;
case 0:
if (server)
strlcpy(s, "Windows Server 2008", len);
strcpy_literal(s, "Windows Server 2008");
else
strlcpy(s, "Windows Vista", len);
strcpy_literal(s, "Windows Vista");
break;
default:
break;
@ -371,7 +371,7 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
case 2:
if (server)
{
strlcpy(s, "Windows Server 2003", len);
strcpy_literal(s, "Windows Server 2003");
if (GetSystemMetrics(SM_SERVERR2))
strlcat(s, " R2", len);
}
@ -379,14 +379,14 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
{
/* Yes, XP Pro x64 is a higher version number than XP x86 */
if (string_is_equal(arch, "x64"))
strlcpy(s, "Windows XP", len);
strcpy_literal(s, "Windows XP");
}
break;
case 1:
strlcpy(s, "Windows XP", len);
strcpy_literal(s, "Windows XP");
break;
case 0:
strlcpy(s, "Windows 2000", len);
strcpy_literal(s, "Windows 2000");
break;
}
break;
@ -395,17 +395,17 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
{
case 0:
if (vi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
strlcpy(s, "Windows 95", len);
strcpy_literal(s, "Windows 95");
else if (vi.dwPlatformId == VER_PLATFORM_WIN32_NT)
strlcpy(s, "Windows NT 4.0", len);
strcpy_literal(s, "Windows NT 4.0");
else
strlcpy(s, "Unknown", len);
strcpy_literal(s, "Unknown");
break;
case 90:
strlcpy(s, "Windows ME", len);
strcpy_literal(s, "Windows ME");
break;
case 10:
strlcpy(s, "Windows 98", len);
strcpy_literal(s, "Windows 98");
break;
}
break;