mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 05:41:02 +00:00
shrunk buffer from 32 to 28 so that all of "Downloading "extremely...longname.wad"" can fit on screen at once.
This commit is contained in:
parent
a66824d63f
commit
aba4adfabc
1 changed files with 7 additions and 7 deletions
|
@ -1157,7 +1157,7 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
if (lastfilenum != -1)
|
if (lastfilenum != -1)
|
||||||
{
|
{
|
||||||
INT32 dldlength;
|
INT32 dldlength;
|
||||||
static char tempname[32];
|
static char tempname[28];
|
||||||
fileneeded_t *file = &fileneeded[lastfilenum];
|
fileneeded_t *file = &fileneeded[lastfilenum];
|
||||||
char *filename = file->filename;
|
char *filename = file->filename;
|
||||||
|
|
||||||
|
@ -1172,16 +1172,16 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
// offset filename to just the name only part
|
// offset filename to just the name only part
|
||||||
filename += strlen(filename) - nameonlylength(filename);
|
filename += strlen(filename) - nameonlylength(filename);
|
||||||
|
|
||||||
if (strlen(filename) > 31) // too long to display fully
|
if (strlen(filename) > sizeof(tempname)-1) // too long to display fully
|
||||||
{
|
{
|
||||||
size_t endhalfpos = strlen(filename)-12;
|
size_t endhalfpos = strlen(filename)-10;
|
||||||
// display as first 16 chars + ... + last 12 chars
|
// display as first 14 chars + ... + last 10 chars
|
||||||
// which should add up to 31 if our math(s) is correct
|
// which should add up to 27 if our math(s) is correct
|
||||||
snprintf(tempname, 31, "%.16s...%.12s", filename, filename+endhalfpos);
|
snprintf(tempname, sizeof(tempname), "%.14s...%.10s", filename, filename+endhalfpos);
|
||||||
}
|
}
|
||||||
else // we can copy the whole thing in safely
|
else // we can copy the whole thing in safely
|
||||||
{
|
{
|
||||||
strncpy(tempname, filename, 31);
|
strncpy(tempname, filename, sizeof(tempname)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP,
|
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP,
|
||||||
|
|
Loading…
Reference in a new issue