mirror of
git://git.musl-libc.org/musl
synced 2024-12-16 19:55:38 +00:00
fix another oob pointer arithmetic issue in printf floating point
this one could never cause any problems unless the compiler/machine goes to extra trouble to break oob pointer arithmetic, but it's best to fix it anyway.
This commit is contained in:
parent
82a4499e67
commit
839bff64a1
@ -319,7 +319,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t)
|
||||
if (j < 9*(z-r-1)) {
|
||||
uint32_t x;
|
||||
/* We avoid C's broken division of negative numbers */
|
||||
d = r + 1 + (j+9*LDBL_MAX_EXP)/9 - LDBL_MAX_EXP;
|
||||
d = r + 1 + ((j+9*LDBL_MAX_EXP)/9 - LDBL_MAX_EXP);
|
||||
j += 9*LDBL_MAX_EXP;
|
||||
j %= 9;
|
||||
for (i=10, j++; j<9; i*=10, j++);
|
||||
|
Loading…
Reference in New Issue
Block a user