From 51ad68b1b139455e38450218e9d499e08ac13f8e Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 16 Sep 2020 20:58:03 -0700 Subject: Fixed strncpy_s errors --- Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp index 246811be..ad29fd21 100644 --- a/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp @@ -26,8 +26,6 @@ */ #include "pch.h" -#include - #include "RenderDeviceVkImpl.hpp" #include "PipelineStateVkImpl.hpp" #include "ShaderVkImpl.hpp" @@ -162,7 +160,10 @@ RenderDeviceVkImpl::RenderDeviceVkImpl(IReferenceCounters* const auto& DeviceProps = m_PhysicalDevice->GetProperties(); - strncpy_s(AdapterInfo.Description, DeviceProps.deviceName, _countof(AdapterInfo.Description) - 1); + static_assert(_countof(AdapterInfo.Description) <= _countof(DeviceProps.deviceName), ""); + for (size_t i = 0; i < _countof(AdapterInfo.Description) - 1 && DeviceProps.deviceName[i] != 0; ++i) + AdapterInfo.Description[i] = DeviceProps.deviceName[i]; + AdapterInfo.Type = ADAPTER_TYPE_HARDWARE; AdapterInfo.Vendor = VendorIdToAdapterVendor(DeviceProps.vendorID); AdapterInfo.VendorId = DeviceProps.vendorID; -- cgit v1.2.3