Add a MSVC / Windows compatible snprintf function (#7353)

Use sizeof where applicable for mt_snprintf
This commit is contained in:
nOOb3167
2018-07-22 21:56:06 +02:00
committed by SmallJoker
parent 9855651c06
commit 9537cfd3f8
13 changed files with 54 additions and 18 deletions

View File

@@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiscalingfilter.h"
#include "imagefilters.h"
#include "porting.h"
#include "settings.h"
#include "util/numeric.h"
#include <cstdio>
@@ -78,7 +79,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
// Calculate scaled texture name.
char rectstr[200];
snprintf(rectstr, sizeof(rectstr), "%d:%d:%d:%d:%d:%d",
porting::mt_snprintf(rectstr, sizeof(rectstr), "%d:%d:%d:%d:%d:%d",
srcrect.UpperLeftCorner.X,
srcrect.UpperLeftCorner.Y,
srcrect.getWidth(),