httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: Agenda for 1.2b7
Date Thu, 06 Feb 1997 19:59:39 GMT
On Thu, 6 Feb 1997, Marc Slemko wrote:
> Sorry, mean unsigned int.  something like %u and (unsigned int)...

Ah ok now it makes more sense.  Here's a totally untested patch. 
Essentially the code as it stands is wrong because it uses va_arg( xxx,
int ) to pull the unsigned quantity off the stack.  At any rate this
should give someone with an alpha to test on something to work with.

(This is more in line with what you'll find in the linux libc source for
this same problem.) 

Dean

Index: util_snprintf.c
===================================================================
RCS file: /export/home/cvs/apache/src/util_snprintf.c,v
retrieving revision 1.4
diff -c -3 -r1.4 util_snprintf.c
*** util_snprintf.c	1997/01/20 23:55:11	1.4
--- util_snprintf.c	1997/02/06 19:57:42
***************
*** 671,683 ****
  	     *   It is reset to ' ' by non-numeric formats
  	     */
  	    switch (*fmt) {
  	    case 'd':
  	    case 'i':
- 	    case 'u':
  		if (is_long)
  		    i_num = va_arg(ap, wide_int);
  		else
  		    i_num = (wide_int) va_arg(ap, int);
  		s = conv_10(i_num, (*fmt) == 'u', &is_negative,
  			    &num_buf[NUM_BUF_SIZE], &s_len);
  		FIX_PRECISION(adjust_precision, precision, s, s_len);
--- 671,689 ----
  	     *   It is reset to ' ' by non-numeric formats
  	     */
  	    switch (*fmt) {
+ 	    case 'u':
+ 		if (is_long)
+ 		    i_num = va_arg(ap, u_wide_int);
+ 		else
+ 		    i_num = (wide_int) va_arg(ap, unsigned int);
+ 		goto do_that_int_thing;
  	    case 'd':
  	    case 'i':
  		if (is_long)
  		    i_num = va_arg(ap, wide_int);
  		else
  		    i_num = (wide_int) va_arg(ap, int);
+ do_that_int_thing:
  		s = conv_10(i_num, (*fmt) == 'u', &is_negative,
  			    &num_buf[NUM_BUF_SIZE], &s_len);
  		FIX_PRECISION(adjust_precision, precision, s, s_len);



Mime
View raw message