diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-09-17 03:58:03 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-09-17 03:58:03 +0000 |
| commit | 51ad68b1b139455e38450218e9d499e08ac13f8e (patch) | |
| tree | c598e64e3787925d89e2009acea72f3093bf3712 /Graphics/GraphicsEngineVulkan | |
| parent | Removed AdapterAttribs struct that was a duplicate of GraphicsAdapterInfo. Mo... (diff) | |
| download | DiligentCore-51ad68b1b139455e38450218e9d499e08ac13f8e.tar.gz DiligentCore-51ad68b1b139455e38450218e9d499e08ac13f8e.zip | |
Fixed strncpy_s errors
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/RenderDeviceVkImpl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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 <string.h> - #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; |
