Ensure that calculated length is an integer.
This commit is contained in:
parent
6870d77acb
commit
a67a637b11
@ -33,7 +33,7 @@
|
||||
#define MB MEGABYTE_BYTE
|
||||
#define GB GIGABYTE_BYTE
|
||||
|
||||
#define CALCLEN(i) (floor(log10(abs(i))) + 1)
|
||||
#define CALCLEN(i) ((size_t)(floor(log10(abs(i))) + 1))
|
||||
|
||||
#define UINTLEN(i) (i<10 ? 1 : (i<100 ? 2 : (i<1000 ? 3 : CALCLEN(i))))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user