Skip to content

Commit dcf2a0e

Browse files
committed
Replaced strcpy, strcat and sprintf with xr_* analogs
1 parent aed5f01 commit dcf2a0e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
248248
{
249249
string_path name;
250250
strcpy_s(name, _name);
251-
if (0 == GEnv.Render->m_MSAASample) strcat(name, "_0");
252-
if (1 == GEnv.Render->m_MSAASample) strcat(name, "_1");
253-
if (2 == GEnv.Render->m_MSAASample) strcat(name, "_2");
254-
if (3 == GEnv.Render->m_MSAASample) strcat(name, "_3");
255-
if (4 == GEnv.Render->m_MSAASample) strcat(name, "_4");
256-
if (5 == GEnv.Render->m_MSAASample) strcat(name, "_5");
257-
if (6 == GEnv.Render->m_MSAASample) strcat(name, "_6");
258-
if (7 == GEnv.Render->m_MSAASample) strcat(name, "_7");
251+
if (0 == GEnv.Render->m_MSAASample) xr_strcat(name, "_0");
252+
if (1 == GEnv.Render->m_MSAASample) xr_strcat(name, "_1");
253+
if (2 == GEnv.Render->m_MSAASample) xr_strcat(name, "_2");
254+
if (3 == GEnv.Render->m_MSAASample) xr_strcat(name, "_3");
255+
if (4 == GEnv.Render->m_MSAASample) xr_strcat(name, "_4");
256+
if (5 == GEnv.Render->m_MSAASample) xr_strcat(name, "_5");
257+
if (6 == GEnv.Render->m_MSAASample) xr_strcat(name, "_6");
258+
if (7 == GEnv.Render->m_MSAASample) xr_strcat(name, "_7");
259259
LPSTR N = LPSTR(name);
260260
map_PS::iterator I = m_ps.find(N);
261261
if (I != m_ps.end()) return I->second;

src/Layers/xrRenderPC_GL/gl_rendertarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ CRenderTarget::CRenderTarget()
785785
for (int it1 = 0; it1 < TEX_jitter_count - 1; it1++)
786786
{
787787
string_path name;
788-
sprintf(name, "%s%d",r2_jitter, it1);
788+
xr_sprintf(name, "%s%d", r2_jitter, it1);
789789
CHK_GL (glBindTexture(GL_TEXTURE_2D, t_noise_surf[it1]));
790790
CHK_GL (glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, TEX_jitter, TEX_jitter));
791791
t_noise[it1] = RImplementation.Resources->_CreateTexture(name);
@@ -821,7 +821,7 @@ CRenderTarget::CRenderTarget()
821821
// generate HBAO jitter texture (last)
822822
int it = TEX_jitter_count - 1;
823823
string_path name;
824-
sprintf(name, "%s%d",r2_jitter, it);
824+
xr_sprintf(name, "%s%d", r2_jitter, it);
825825
CHK_GL (glBindTexture(GL_TEXTURE_2D, t_noise_surf[it]));
826826
CHK_GL (glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA32F, TEX_jitter, TEX_jitter));
827827
t_noise[it] = RImplementation.Resources->_CreateTexture(name);

src/utils/xrDXT/NormalMapGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,12 @@ int DXTCompressBump(
651651
fmt0.type = STextureParams::ttImage;
652652
fmt0.fmt = STextureParams::tfDXT5;
653653
string256 out_name1;
654-
strcpy(out_name1, out_name);
654+
xr_strcpy(out_name1, out_name);
655655
if (strext(out_name1))
656656
{
657657
*strext(out_name1) = 0;
658658
}
659-
strcat(out_name1, "#.dds");
659+
xr_strcat(out_name1, "#.dds");
660660
res |= DXTCompressImage(out_name1, T_normal_1D, w, h, pitch, &fmt0, depth);
661661
free(T_height_pf);
662662
free(T_normal_1D);

0 commit comments

Comments
 (0)