fixes strncpy & buf size

Origin commit data
------------------
Commit: 7359504dd7
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-08-07 (Tue, 07 Aug 2012)

Origin message was:
------------------
-fixes strncpy & buf size
This commit is contained in:
Jacek Jendrzej
2012-08-07 18:51:44 +02:00
parent 15881f579e
commit 57a7091601
15 changed files with 48 additions and 44 deletions

View File

@@ -501,7 +501,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
sprintf (buf, "20:9");
break;
default:
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf));
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf)-1);
}
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
@@ -535,7 +535,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
snprintf (buf,sizeof(buf), "60fps");
break;
default:
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf));
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf)-1);
break;
}
g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8