Skip to content

Commit bd1b0e8

Browse files
author
Bart Roossien
committed
Some fixes
1 parent c4433a0 commit bd1b0e8

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

Core/Libraries/Source/WWVegas/WWDownload/FTP.CPP

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,8 +1831,7 @@ bool Prepare_Directories(const char *rootdir, const char *filename)
18311831
const char *cptr=filename;
18321832
while(cptr=strchr(cptr,'\\'))
18331833
{
1834-
memset(tempstr,0,256);
1835-
strlcpy(tempstr,filename,cptr-filename);
1834+
strlcpy(tempstr,filename,cptr-filename + 1);
18361835
sprintf(newdir,"%s\\%s",rootdir, tempstr);
18371836
if (!CreateDirectory(newdir, NULL))
18381837
return false;

Core/Libraries/Source/profile/profile_highlevel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ ProfileHighLevel::Block::Block(const char *name)
9292
m_idTime=AddProfile(name,NULL,"msec",6,-4);
9393

9494
char help[256];
95-
strlcpy(help, name, sizeof(help) - 2);
96-
strcat(help,".c");
95+
strlcpy(help, name, sizeof(help) - 3);
96+
strlcat(help, ".c", sizeof(help));
9797
AddProfile(help,NULL,"calls",6,0).Increment();
9898

9999
ProfileGetTime(m_start);

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,8 @@ Shadow* W3DProjectedShadowManager::addDecal(Shadow::ShadowTypeInfo *shadowInfo)
14851485
//simple decal using the premade texture specified.
14861486
//can be always perpendicular to model's z-axis or projected
14871487
//onto world geometry.
1488-
strcpy(texture_name, shadowInfo->m_ShadowName);
1489-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1488+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1489+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
14901490

14911491
//Check if we previously added a decal using this texture
14921492
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1589,8 +1589,8 @@ Shadow* W3DProjectedShadowManager::addDecal(RenderObjClass *robj, Shadow::Shadow
15891589
//simple decal using the premade texture specified.
15901590
//can be always perpendicular to model's z-axis or projected
15911591
//onto world geometry.
1592-
strcpy(texture_name, shadowInfo->m_ShadowName);
1593-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1592+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1593+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
15941594

15951595
//Check if we previously added a decal using this texture
15961596
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1722,8 +1722,8 @@ W3DProjectedShadow* W3DProjectedShadowManager::addShadow(RenderObjClass *robj, S
17221722
}
17231723
else
17241724
{
1725-
strcpy(texture_name, shadowInfo->m_ShadowName);
1726-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1725+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1726+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
17271727
}
17281728

17291729
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1898,8 +1898,8 @@ W3DProjectedShadow* W3DProjectedShadowManager::createDecalShadow(Shadow::ShadowT
18981898
}
18991899
else
19001900
{
1901-
strcpy(texture_name, shadowInfo->m_ShadowName);
1902-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1901+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1902+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
19031903
}
19041904

19051905
st=m_W3DShadowTextureManager->getTexture(texture_name);

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,8 @@ Shadow* W3DProjectedShadowManager::addDecal(Shadow::ShadowTypeInfo *shadowInfo)
14851485
//simple decal using the premade texture specified.
14861486
//can be always perpendicular to model's z-axis or projected
14871487
//onto world geometry.
1488-
strcpy(texture_name, shadowInfo->m_ShadowName);
1489-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1488+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1489+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
14901490

14911491
//Check if we previously added a decal using this texture
14921492
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1589,8 +1589,8 @@ Shadow* W3DProjectedShadowManager::addDecal(RenderObjClass *robj, Shadow::Shadow
15891589
//simple decal using the premade texture specified.
15901590
//can be always perpendicular to model's z-axis or projected
15911591
//onto world geometry.
1592-
strcpy(texture_name, shadowInfo->m_ShadowName);
1593-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1592+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1593+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
15941594

15951595
//Check if we previously added a decal using this texture
15961596
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1722,8 +1722,8 @@ W3DProjectedShadow* W3DProjectedShadowManager::addShadow(RenderObjClass *robj, S
17221722
}
17231723
else
17241724
{
1725-
strcpy(texture_name, shadowInfo->m_ShadowName);
1726-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1725+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1726+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
17271727
}
17281728

17291729
st=m_W3DShadowTextureManager->getTexture(texture_name);
@@ -1898,8 +1898,8 @@ W3DProjectedShadow* W3DProjectedShadowManager::createDecalShadow(Shadow::ShadowT
18981898
}
18991899
else
19001900
{
1901-
strcpy(texture_name, shadowInfo->m_ShadowName);
1902-
strlcpy(texture_name, ".tga", ARRAY_SIZE(texture_name));
1901+
strlcpy(texture_name, shadowInfo->m_ShadowName, ARRAY_SIZE(texture_name));
1902+
strlcat(texture_name, ".tga", ARRAY_SIZE(texture_name));
19031903
}
19041904

19051905
st=m_W3DShadowTextureManager->getTexture(texture_name);

0 commit comments

Comments
 (0)