replace strncat calls by Q_strlcat calls

This commit is contained in:
svdijk 2013-05-11 13:24:13 +02:00
parent a26892cb90
commit 4682c888f0
5 changed files with 5 additions and 6 deletions

View file

@ -92,7 +92,7 @@ LoadJPG(char *origname, byte **pic, int *width, int *height)
len = strlen(filename);
if (len >= 4 && strcmp(filename + len - 4, ".jpg"))
{
strncat(filename, ".jpg", sizeof(filename) - 1 - len);
Q_strlcat(filename, ".jpg", sizeof(filename));
}
*pic = NULL;

View file

@ -45,7 +45,7 @@ LoadPCX(char *origname, byte **pic, byte **palette, int *width, int *height)
filelen = strlen(filename);
if (filelen >= 4 && strcmp(filename + filelen - 4, ".pcx"))
{
strncat(filename, ".pcx", sizeof(filename) - 1 - filelen);
Q_strlcat(filename, ".pcx", sizeof(filename));
}
*pic = NULL;

View file

@ -57,7 +57,7 @@ LoadTGA(char *origname, byte **pic, int *width, int *height)
len = strlen(name);
if (len >= 4 && strcmp(name + len - 4, ".tga"))
{
strncat(name, ".tga", sizeof(name) - 1 - len);
Q_strlcat(name, ".tga", sizeof(name));
}
*pic = NULL;

View file

@ -42,7 +42,7 @@ LoadWal(char *origname)
len = strlen(name);
if (len >= 4 && strcmp(name + len - 4, ".wal"))
{
strncat(name, ".wal", sizeof(name) - 1 - len);
Q_strlcat(name, ".wal", sizeof(name));
}
ri.FS_LoadFile(name, (void **)&mt);

View file

@ -243,8 +243,7 @@ SV_WriteServerFile(qboolean autosave)
newtime->tm_hour, newtime->tm_min / 10,
newtime->tm_min % 10, newtime->tm_mon + 1,
newtime->tm_mday);
strncat(comment, sv.configstrings[CS_NAME],
sizeof(comment) - 1 - strlen(comment));
Q_strlcat(comment, sv.configstrings[CS_NAME], sizeof(comment));
}
else
{