1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00
* stdio-common/vfprintf.c: Remove limitation on size of precision
	for integers.
This commit is contained in:
Ulrich Drepper
1999-09-12 21:23:32 +00:00
parent 7814856974
commit 3e95f6602b
2 changed files with 53 additions and 50 deletions

View File

@@ -1,5 +1,8 @@
1999-09-12 Ulrich Drepper <drepper@cygnus.com> 1999-09-12 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/vfprintf.c: Remove limitation on size of precision
for integers.
* posix/fnmatch.c (internal_fnmatch): Make it compilable outside * posix/fnmatch.c (internal_fnmatch): Make it compilable outside
glibc by defining internal_function if it isn't already. glibc by defining internal_function if it isn't already.

View File

@@ -687,19 +687,15 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
} \ } \
} \ } \
\ \
prec -= workend - string; \ if (prec <= workend - string && number.word != 0 && alt && base == 8) \
\
if (prec > 0) \
/* Add zeros to the precision. */ \
while (prec-- > 0) \
*string-- = L_('0'); \
else if (number.word != 0 && alt && base == 8) \
/* Add octal marker. */ \ /* Add octal marker. */ \
*string-- = L_('0'); \ *string-- = L_('0'); \
\ \
prec = MAX (0, prec - (workend - string)); \
\
if (!left) \ if (!left) \
{ \ { \
width -= workend - string; \ width -= workend - string + prec; \
\ \
if (number.word != 0 && alt && base == 16) \ if (number.word != 0 && alt && base == 16) \
/* Account for 0X hex marker. */ \ /* Account for 0X hex marker. */ \
@@ -708,63 +704,67 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
if (is_negative || showsign || space) \ if (is_negative || showsign || space) \
--width; \ --width; \
\ \
if (pad == L_('0')) \ if (pad == L_(' ')) \
{ \ { \
while (width-- > 0) \ PAD (L_(' ')); \
*string-- = L_('0'); \ width = 0; \
\
if (number.word != 0 && alt && base == 16) \
{ \
*string-- = spec; \
*string-- = L_('0'); \
} \
\
if (is_negative) \
*string-- = L_('-'); \
else if (showsign) \
*string-- = L_('+'); \
else if (space) \
*string-- = L_(' '); \
} \ } \
else \ \
if (is_negative) \
PUTC (L_('-'), s); \
else if (showsign) \
PUTC (L_('+'), s); \
else if (space) \
PUTC (L_(' '), s); \
\
if (number.word != 0 && alt && base == 16) \
{ \ { \
if (number.word != 0 && alt && base == 16) \ PUTC (L_('0'), s); \
{ \ PUTC (spec, s); \
*string-- = spec; \
*string-- = L_('0'); \
} \
\
if (is_negative) \
*string-- = L_('-'); \
else if (showsign) \
*string-- = L_('+'); \
else if (space) \
*string-- = L_(' '); \
\
while (width-- > 0) \
*string-- = L_(' '); \
} \ } \
\ \
width += prec; \
PAD (L_('0')); \
\
outstring (string + 1, workend - string); \ outstring (string + 1, workend - string); \
\ \
break; \ break; \
} \ } \
else \ else \
{ \ { \
if (number.word != 0 && alt && base == 16) \ if (is_negative) \
{ \ { \
*string-- = spec; \ PUTC (L_('-'), s); \
*string-- = L_('0'); \ --width; \
} \
else if (showsign) \
{ \
PUTC (L_('+'), s); \
--width; \
} \
else if (space) \
{ \
PUTC (L_(' '), s); \
--width; \
} \ } \
\ \
if (is_negative) \ if (number.word != 0 && alt && base == 16) \
*string-- = L_('-'); \ { \
else if (showsign) \ PUTC (L_('0'), s); \
*string-- = L_('+'); \ PUTC (spec, s); \
else if (space) \ width -= 2; \
*string-- = L_(' '); \ } \
\
width -= workend - string + prec; \
\
if (prec > 0) \
{ \
int temp = width; \
width = prec; \
PAD (L_('0'));; \
width = temp; \
} \
\ \
width -= workend - string; \
outstring (string + 1, workend - string); \ outstring (string + 1, workend - string); \
\ \
PAD (L_(' ')); \ PAD (L_(' ')); \