updated visual studio project

This commit is contained in:
2023-02-08 03:04:04 +06:00
parent 52c2d2f855
commit 75f023a4bd
4 changed files with 63 additions and 18 deletions

View File

@@ -67,7 +67,7 @@ typedef uint8 bool;
#endif
#ifndef sprintf_s
#define sprintf_s(BUF, BUFSIZE, FORMAT, ...) sprintf(BUF, FORMAT, ## __VA_ARGS__)
//#define sprintf_s(BUF, BUFSIZE, FORMAT, ...) sprintf(BUF, FORMAT, ## __VA_ARGS__)
#endif

View File

@@ -67,7 +67,10 @@ char* toString_uint(uint64 n, bool withPostfix, bool uppercase){
throw("too big precision");\
if(precision==0)\
precision=toString_float_default_precision;\
int cn=sprintf(str, "%.*f", precision, n);\
int cn=IFMSC(\
sprintf_s(str, bufsize, "%.*f", precision, n),\
sprintf(str, "%.*f", precision, n)\
);\
/* remove trailing zeroes except .0*/\
while(str[cn-1]=='0' && str[cn-2]!='.')\
cn--;\