fix crash for very fast targets

This commit is contained in:
van Hauser
2020-12-17 22:57:28 +01:00
parent 14c67f15c9
commit fd6bff727a
3 changed files with 8 additions and 0 deletions

View File

@ -26,6 +26,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <math.h>
#include "debug.h"
#include "alloc-inl.h"
@ -786,6 +787,10 @@ u8 *u_stringify_float(u8 *buf, double val) {
sprintf(buf, "%0.01f", val);
} else if (unlikely(isnan(val) || isfinite(val))) {
strcpy(buf, "999.9");
} else {
return u_stringify_int(buf, (u64)val);