* smallprint.c (rnarg): Use long rather than unsigned long so that we get

proper sign extension.
This commit is contained in:
Christopher Faylor 2005-01-31 20:55:33 +00:00
parent c824aa4330
commit 4faae8d6e9
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2005-01-31 Christopher Faylor <cgf@timesys.com>
* smallprint.c (rnarg): Use long rather than unsigned long so that we
get proper sign extension.
2005-01-31 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (set_traverse): New function.

View File

@ -21,7 +21,7 @@ int __small_vsprintf (char *dst, const char *fmt, va_list ap);
#define LLMASK (0xffffffffffffffffULL)
#define LMASK (0xffffffff)
#define rnarg(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, unsigned), len, pad, LMASK)
#define rnarg(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, long), len, pad, LMASK)
#define rnargLL(dst, base, dosign, len, pad) __rn ((dst), (base), (dosign), va_arg (ap, unsigned long long), len, pad, LLMASK)
static char * __rn (char *, int, int, long long, int, int,
@ -63,9 +63,7 @@ __rn (char *dst, int base, int dosign, long long val, int len, int pad, unsigned
*dst++ = pad;
while (l > 0)
{
*dst++ = res[--l];
}
return dst;
}