aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-27 08:03:32 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-27 08:03:32 +0000
commit40a54e4d8d66e81a2a5dd5de020ae97cd0019b01 (patch)
tree960b008144bc080d27ae064c70106fa5052d4424 /stdio-common/vfprintf.c
parent7661d9f7838cedc4e35bf86b83cd4d27e41c8e4d (diff)
downloadglibc-40a54e4d8d66e81a2a5dd5de020ae97cd0019b01.zip
glibc-40a54e4d8d66e81a2a5dd5de020ae97cd0019b01.tar.gz
glibc-40a54e4d8d66e81a2a5dd5de020ae97cd0019b01.tar.bz2
Update.
2003-05-27 Jakub Jelinek <jakub@redhat.com> * stdio-common/vfprintf.c (process_arg, process_string_arg): Use pa_int/pa_u_int instead of pa_short_int, pa_u_short_int and pa_char. * stdio-common/printf-parse.h (union printf_arg): Remove pa_char, pa_short_int, pa_u_short_int and pa_float. 2003-05-26 Jakub Jelinek <jakub@redhat.com> * libio/strops.c (_IO_str_init_static): Change into a wrapper around _IO_str_init_static_internal. (_IO_str_init_static_internal): Moved from _IO_str_init_static, change size argument to _IO_size_t, don't limit sprintf to 64M. (_IO_str_init_readonly): Call _IO_str_init_static_internal. * libio/wstrops.c (_IO_wstr_init_static): Change size argument to _IO_size_t, don't limit swprintf to 256M. (_IO_wstr_init_readonly): Remove. * libio/libioP.h (_IO_str_init_static_internal, _IO_wstr_init_static): Adjust prototypes. (_IO_wstr_init_readonly): Remove prototype. * libio/iovsprintf.c (_IO_vsprintf): Use _IO_str_init_static_internal instead of INTUSE(_IO_str_init_static). * libio/iovsscanf.c (_IO_vsscanf): Likewise. * libio/memstream.c (open_memstream): Likewise. * libio/obprintf.c (_IO_obstack_vfprintf): Likewise. * libio/vasprintf.c (_IO_vasprintf): Likewise. * libio/vsnprintf.c (_IO_vsnprintf): Likewise. * stdio-common/tst-sprintf.c (main): Add new test.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index f8e01b7..63440f4 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -581,10 +581,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
else \
if (is_long_num) \
signed_number = args_value[fspec->data_arg].pa_long_int; \
- else if (!is_short) \
+ else /* `char' and `short int' will be promoted to `int'. */ \
signed_number = args_value[fspec->data_arg].pa_int; \
- else \
- signed_number = args_value[fspec->data_arg].pa_short_int; \
\
is_negative = signed_number < 0; \
number.word = is_negative ? (- signed_number) : signed_number; \
@@ -675,12 +673,12 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
number.word = args_value[fspec->data_arg].pa_u_long_int; \
else if (is_char) \
number.word = (unsigned char) \
- args_value[fspec->data_arg].pa_char; \
+ args_value[fspec->data_arg].pa_u_int; \
else if (!is_short) \
number.word = args_value[fspec->data_arg].pa_u_int; \
else \
number.word = (unsigned short int) \
- args_value[fspec->data_arg].pa_u_short_int; \
+ args_value[fspec->data_arg].pa_u_int; \
\
LABEL (number): \
if (prec < 0) \
@@ -977,7 +975,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
outchar (__btowc ((unsigned char) va_arg (ap, int))); /* Promoted. */ \
else \
outchar (__btowc ((unsigned char) \
- args_value[fspec->data_arg].pa_char)); \
+ args_value[fspec->data_arg].pa_int)); \
if (left) \
PAD (L' '); \
break; \
@@ -1096,7 +1094,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
if (fspec == NULL) \
outchar ((unsigned char) va_arg (ap, int)); /* Promoted. */ \
else \
- outchar ((unsigned char) args_value[fspec->data_arg].pa_char); \
+ outchar ((unsigned char) args_value[fspec->data_arg].pa_int); \
if (left) \
PAD (' '); \
break; \