Common/x64/CpuDetect: Disable MSVC warning for strncpy

This commit is contained in:
MerryMage 2016-08-05 18:42:26 +01:00
parent 4c0a85f3b3
commit d31bbd6d14

View file

@ -81,8 +81,18 @@ static CPUCaps Detect() {
else else
caps.vendor = CPUVendor::OTHER; caps.vendor = CPUVendor::OTHER;
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
// Set reasonable default brand string even if brand string not available // Set reasonable default brand string even if brand string not available
strncpy(caps.cpu_string, caps.brand_string, sizeof(caps.cpu_string)); strncpy(caps.cpu_string, caps.brand_string, sizeof(caps.cpu_string));
caps.cpu_string[sizeof(caps.cpu_string) - 1] = '\0';
#ifdef _MSC_VER
#pragma warning(pop)
#endif
// Detect family and other miscellaneous features // Detect family and other miscellaneous features
if (max_std_fn >= 1) { if (max_std_fn >= 1) {