Fix memleak in displayTitleBitmap by allocating static buffer

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4350 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-03-26 12:15:28 +00:00
parent ee286efa0f
commit 0508f962b5
1 changed files with 6 additions and 1 deletions

View File

@ -1427,10 +1427,15 @@ void addSideText(UDWORD id, UDWORD PosX, UDWORD PosY, const char *txt)
// show a background piccy
static void displayTitleBitmap(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, PIELIGHT *pColours)
{
static char versionString[MAX_STR_LENGTH] = {'\0'};
if (versionString[0] == '\0')
strlcpy(versionString, version_getFormattedVersionString(), sizeof(versionString));
iV_SetFont(font_regular);
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
iV_DrawTextRotated(version_getFormattedVersionString(), pie_GetVideoBufferWidth() - 10, pie_GetVideoBufferHeight() - 15, 270.f);
iV_DrawTextRotated(versionString, pie_GetVideoBufferWidth() - 10, pie_GetVideoBufferHeight() - 15, 270.f);
}
// ////////////////////////////////////////////////////////////////////////////