fix uint32_t overflow in format_time
This commit is contained in:
parent
33c0dd0d85
commit
1dc914a675
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ static uint64_t uptime() { return io_read(AM_TIMER_UPTIME).us; }
|
|||
|
||||
static char *format_time(uint64_t us) {
|
||||
static char buf[32];
|
||||
uint32_t ms = us / 1000;
|
||||
uint64_t ms = us / 1000;
|
||||
us -= ms * 1000;
|
||||
assert(us < 1000);
|
||||
int len = sprintf(buf, "%d.000", ms);
|
||||
|
|
Loading…
Reference in a new issue