]> sjero.net Git - wget/commitdiff
[svn] snprintf.c (dopr): Use `unsigned int' as the second argument to va_arg
authorhniksic <devnull@localhost>
Tue, 4 Dec 2001 12:44:58 +0000 (04:44 -0800)
committerhniksic <devnull@localhost>
Tue, 4 Dec 2001 12:44:58 +0000 (04:44 -0800)
when casting to `unsigned short' is intended.
Submitted by Ian Abbott in <3C0CB09F.21762.34A1F1@localhost>.

src/ChangeLog
src/snprintf.c

index 6ad6e599e7dc93d630b6c896fc55b3e8cfbd90c5..d98835e86214c1c968ed856a20b65664747d7a8a 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-04  Ian Abbott <abbotti@mev.co.uk>
+
+       * snprintf.c (dopr): Use `unsigned int' as the second argument to
+       va_arg when casting to `unsigned short' is intended.
+
 2001-12-04  Herold Heiko  <Heiko.Herold@previnet.it>
 
        * gen_sslfunc.c: on windows provide ssl crypto random 
index ea8d5002d374e19fc81857c3bfe7a37655f05fb9..4d1c3dd5788adf8fa2bbbe10add7b9fcdb3b977d 100644 (file)
@@ -321,7 +321,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
       case 'o':
        flags |= DP_F_UNSIGNED;
        if (cflags == DP_C_SHORT)
-         value = (short int)va_arg (args, int);
+         value = (unsigned short int)va_arg (args, unsigned int);
        else if (cflags == DP_C_LONG)
          value = va_arg (args, unsigned long int);
        else if (cflags == DP_C_LLONG)
@@ -333,7 +333,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
       case 'u':
        flags |= DP_F_UNSIGNED;
        if (cflags == DP_C_SHORT)
-         value = (unsigned short int)va_arg (args, int);
+         value = (unsigned short int)va_arg (args, unsigned int);
        else if (cflags == DP_C_LONG)
          value = va_arg (args, unsigned long int);
        else if (cflags == DP_C_LLONG)
@@ -347,7 +347,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
       case 'x':
        flags |= DP_F_UNSIGNED;
        if (cflags == DP_C_SHORT)
-         value = (short int)va_arg (args, int);
+         value = (unsigned short int)va_arg (args, unsigned int);
        else if (cflags == DP_C_LONG)
          value = va_arg (args, unsigned long int);
        else if (cflags == DP_C_LLONG)