Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so Treat short and byte print formats as and ...



details:   https://anonhg.NetBSD.org/src/rev/a884d353e822
branches:  trunk
changeset: 494164:a884d353e822
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jul 03 03:32:57 2000 +0000

description:
Treat short and byte print formats as and cast to the right size.

diffstat:

 libexec/ld.elf_so/xprintf.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r d70ff138598c -r a884d353e822 libexec/ld.elf_so/xprintf.c
--- a/libexec/ld.elf_so/xprintf.c       Mon Jul 03 03:31:47 2000 +0000
+++ b/libexec/ld.elf_so/xprintf.c       Mon Jul 03 03:32:57 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xprintf.c,v 1.6 2000/04/02 23:04:32 soren Exp $         */
+/*     $NetBSD: xprintf.c,v 1.7 2000/07/03 03:32:57 matt Exp $  */
 
 /*
  * Copyright 1996 Matt Thomas <matt%3am-software.com@localhost>
@@ -30,6 +30,7 @@
 #include <sys/cdefs.h>
 #include "rtldenv.h"
 #include <string.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
 #ifdef __STDC__
@@ -94,12 +95,12 @@
                                unsigned long long uval;
                                char digits[sizeof(int) * 3], *dp = digits;
 #define        SARG() \
-(size & SZ_SHORT ? va_arg(ap, short) : \
+(size & SZ_SHORT ? (short) va_arg(ap, int) : \
 size & SZ_LONG ? va_arg(ap, long) : \
 size & SZ_QUAD ? va_arg(ap, long long) : \
 va_arg(ap, int))
 #define        UARG() \
-(size & SZ_SHORT ? va_arg(ap, unsigned short) : \
+(size & SZ_SHORT ? (unsigned short) va_arg(ap, unsigned int) : \
 size & SZ_LONG ? va_arg(ap, unsigned long) : \
 size & SZ_QUAD ? va_arg(ap, unsigned long long) : \
 va_arg(ap, unsigned int))



Home | Main Index | Thread Index | Old Index