about summary refs log tree commit diff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-24 20:54:13 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-24 20:54:13 +0000
commitb3f7c6654e6384333c7347c301b208b7a6ce9560 (patch)
tree8662f7b0e377f5df87a4f8583ea34ecc10c6706b /stdio-common/vfprintf.c
parentd2a99fa30393d4b5f1e5260ce8a28fa0648c6eb2 (diff)
downloadglibc-b3f7c6654e6384333c7347c301b208b7a6ce9560.tar.gz
glibc-b3f7c6654e6384333c7347c301b208b7a6ce9560.tar.xz
glibc-b3f7c6654e6384333c7347c301b208b7a6ce9560.zip
Update.
2000-09-24  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/vfprintf.c (process_arg): Handle %hhn.
	Add missing case in va_arg handling for numbers.
	* stdio-common/tst-printf.c (main): Add tests for %hhu and %hhn
	handling.  Reported by Joseph S. Myers <jsm28@cam.ac.uk>.
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 6219d795f8..adfb65100c 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -660,6 +660,8 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	    {								      \
 	      if (is_long_num)						      \
 		number.word = va_arg (ap, unsigned long int);		      \
+	      else if (is_char)						      \
+	        number.word = (unsigned char) va_arg (ap, unsigned int);      \
 	      else if (!is_short)					      \
 		number.word = va_arg (ap, unsigned int);		      \
 	      else							      \
@@ -935,6 +937,10 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	    *(long long int *) va_arg (ap, void *) = done;		      \
 	  else if (is_long_num)						      \
 	    *(long int *) va_arg (ap, void *) = done;			      \
+	  else if (is_char)						      \
+	    *(char *) va_arg (ap, void *) = done;			      \
+	  else if (is_long_num)						      \
+	    *(long int *) va_arg (ap, void *) = done;			      \
 	  else if (!is_short)						      \
 	    *(int *) va_arg (ap, void *) = done;			      \
 	  else								      \
@@ -945,6 +951,10 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	  *(long long int *) args_value[fspec->data_arg].pa_pointer = done;   \
 	else if (is_long_num)						      \
 	  *(long int *) args_value[fspec->data_arg].pa_pointer = done;	      \
+	else if (is_long_num)						      \
+	  *(long int *) args_value[fspec->data_arg].pa_pointer = done;	      \
+	else if (is_char)						      \
+	  *(char *) args_value[fspec->data_arg].pa_pointer = done;	      \
 	else if (!is_short)						      \
 	  *(int *) args_value[fspec->data_arg].pa_pointer = done;	      \
 	else								      \