]> sjero.net Git - wget/blobdiff - src/snprintf.c
[svn] Move fnmatch() to cmpt.c and don't use it under GNU libc.
[wget] / src / snprintf.c
index e9a643e347ee22d1c96727d5385217a861ea4a90..f8dffa4ab12a4a380146c8e405acc10181ce62b4 100644 (file)
  *    fixed return value to comply with C99
  *    fixed handling of snprintf(NULL, ...)
  *
- *  Hrvoje Niksic <hniksic@arsdigita.com> 2000-11-04
+ *  Hrvoje Niksic <hniksic@xemacs.org> 2000-11-04
  *    include <config.h> instead of "config.h".
  *    moved TEST_SNPRINTF stuff out of HAVE_SNPRINTF ifdef.
  *    include <stdio.h> for NULL.
  *    added support and test cases for long long.
  *    don't declare argument types to (v)snprintf if stdarg is not used.
+ *    use int instead of short int as 2nd arg to va_arg.
  *
  **************************************************************/
 
@@ -308,7 +309,7 @@ static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
       case 'd':
       case 'i':
        if (cflags == DP_C_SHORT) 
-         value = va_arg (args, short int);
+         value = (short int)va_arg (args, int);
        else if (cflags == DP_C_LONG)
          value = va_arg (args, long int);
        else if (cflags == DP_C_LLONG)
@@ -320,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 = va_arg (args, unsigned short 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)
@@ -332,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 = va_arg (args, unsigned short 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)
@@ -346,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 = va_arg (args, unsigned short 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)