mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 04:31:09 +00:00
replace strncat calls by Q_strlcat calls
This commit is contained in:
parent
a26892cb90
commit
4682c888f0
5 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue