mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 10:02:01 +00:00
replace the 3 strncpys with a snprintf
This commit is contained in:
parent
426983ff11
commit
b060d98c28
1 changed files with 1 additions and 3 deletions
|
|
@ -1177,9 +1177,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
size_t endhalfpos = strlen(filename)-12;
|
size_t endhalfpos = strlen(filename)-12;
|
||||||
// display as first 16 chars + ... + last 12 chars
|
// display as first 16 chars + ... + last 12 chars
|
||||||
// which should add up to 31 if our math(s) is correct
|
// which should add up to 31 if our math(s) is correct
|
||||||
strncpy(tempname, filename, 16);
|
snprintf(tempname, 31, "%.16s...%.12s", filename, filename+endhalfpos);
|
||||||
strncpy(tempname+16, "...", 3);
|
|
||||||
strncpy(tempname+16+3, filename+endhalfpos, 12);
|
|
||||||
}
|
}
|
||||||
else // we can copy the whole thing in safely
|
else // we can copy the whole thing in safely
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue