fernly: Fix printf("%d") > 99999

This adds lots of divison code, which fixes, among other things,
calling printf() with %d greater than 99999.
This commit is contained in:
Sean Cross 2014-09-11 10:38:34 +08:00
parent 05532408dc
commit 1c3ef737bf
5 changed files with 245 additions and 22 deletions

View file

@ -251,7 +251,7 @@ static noinline char* put_dec(char *buf, unsigned NUM_TYPE num)
unsigned rem;
if (num < 100000)
return put_dec_trunc(buf, num);
rem = _udiv64(num, 100000);
rem = do_div(num, 100000);
buf = put_dec_full(buf, rem);
}
}