diff options
Diffstat (limited to 'src/util/snprintf.c')
-rw-r--r-- | src/util/snprintf.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util/snprintf.c b/src/util/snprintf.c index 99d4b64a..458338fd 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -56,6 +56,10 @@ * Tom Goodale <goodale@aei-potsdam.mpg.de> 2001-05-24 * Put into CCTK * + * Tom Goodale <goodale@aei-potsdam.mpg.de> 2001-06-23 + * Short ints get promoted to ints by compiler, so changed args to va_arg + * to reflect this. + * **************************************************************/ @@ -285,7 +289,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 = va_arg (args, int); else if (cflags == DP_C_LONG) value = va_arg (args, long int); else @@ -295,7 +299,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 = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = va_arg (args, unsigned long int); else @@ -305,7 +309,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 = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = va_arg (args, unsigned long int); else @@ -317,7 +321,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 = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = va_arg (args, unsigned long int); else |