fix "no snprintf on VS"

This commit is contained in:
ac-stef
2016-10-16 14:37:08 +02:00
parent 1b5877e3fc
commit 701d33af55
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -519,11 +519,11 @@ void intret(int v)
const char *floatstr(float v, bool neat)
{
static string s;
static char s[2 * MAXSTRLEN];
static int i = 0;
if(i > MAXSTRLEN - 100) i = 0;
if(i > MAXSTRLEN - 10) i = 0;
char *t = s + i;
snprintf(t, 99, !neat && (v) == int(v) ? "%.1f" : "%.7g", v); // was ftoa()
formatstring(t)(!neat && (v) == int(v) ? "%.1f" : "%.7g", v); // was ftoa()
i += strlen(t) + 1;
return t;
}