Sfoglia il codice sorgente

Use correct calculation for `dStrncat`

Johan Mattsson 2 anni fa
parent
commit
77e808cc3a
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Engine/source/gfx/D3D11/gfxD3D11Device.cpp

+ 1 - 1
Engine/source/gfx/D3D11/gfxD3D11Device.cpp

@@ -280,7 +280,7 @@ void GFXD3D11Device::enumerateAdapters(Vector<GFXAdapter*> &adapterList)
       SAFE_DELETE_ARRAY(str);
       SAFE_DELETE_ARRAY(str);
 
 
       dStrncpy(toAdd->mName, Description.c_str(), GFXAdapter::MaxAdapterNameLen);
       dStrncpy(toAdd->mName, Description.c_str(), GFXAdapter::MaxAdapterNameLen);
-      dStrncat(toAdd->mName, " (D3D11)", 8);
+      dStrncat(toAdd->mName, " (D3D11)", sizeof(toAdd->mName) - strlen(toAdd->mName) - 1);
 
 
       IDXGIOutput* pOutput = NULL; 
       IDXGIOutput* pOutput = NULL; 
       HRESULT hr;
       HRESULT hr;