diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 14:45:55 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2007-07-12 14:45:55 +0000 |
commit | 45138560bb92eb77179638ab063917cf5c6026c7 (patch) | |
tree | 29c13ab63d4767b8f1106262f8d09549ade4d94c /stdio-common/_itoa.c | |
parent | cd4d561ca59d8534701158060193d6725ccb1e55 (diff) | |
download | glibc-45138560bb92eb77179638ab063917cf5c6026c7.tar glibc-45138560bb92eb77179638ab063917cf5c6026c7.tar.gz glibc-45138560bb92eb77179638ab063917cf5c6026c7.tar.bz2 glibc-45138560bb92eb77179638ab063917cf5c6026c7.zip |
2007-01-22 Ulrich Drepper <drepper@redhat.com>
[BZ #3902]
* stdio-common/_itoa.c (_itoa): Make sure at least a zero is emitted.
* stdio-common/Makefile (tests): Add bug17.
* stdio-common/bug17.c: New file.
Diffstat (limited to 'stdio-common/_itoa.c')
-rw-r--r-- | stdio-common/_itoa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/stdio-common/_itoa.c b/stdio-common/_itoa.c index f61b23fceb..d018313213 100644 --- a/stdio-common/_itoa.c +++ b/stdio-common/_itoa.c @@ -269,6 +269,7 @@ _itoa (value, buflim, base, upper_case) default: { + char *bufend = buflim; #if BITS_PER_MP_LIMB == 64 mp_limb_t base_multiplier = brec->base_multiplier; if (brec->flag) @@ -454,6 +455,8 @@ _itoa (value, buflim, base, upper_case) } while (n != 0); #endif + if (buflim == bufend) + *--buflim = '0'; } break; } |