diff options
Diffstat (limited to 'winsup/cygwin/smallprint.c')
-rw-r--r-- | winsup/cygwin/smallprint.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/smallprint.c b/winsup/cygwin/smallprint.c index d6be72a6c..97a2b6ce1 100644 --- a/winsup/cygwin/smallprint.c +++ b/winsup/cygwin/smallprint.c @@ -19,11 +19,11 @@ int __small_sprintf (char *dst, const char *fmt,...); int __small_vsprintf (char *dst, const char *fmt, va_list ap); static char * -rn (char *dst, int base, int dosign, int val, int len, int pad) +rn (char *dst, int base, int dosign, long long val, int len, int pad) { - /* longest number is 4294967295, 10 digits */ + /* longest number is ULLONG_MAX, 18446744073709551615, 20 digits */ unsigned uval; - char res[10]; + char res[20]; static const char str[16] = "0123456789ABCDEF"; int l = 0; @@ -126,9 +126,15 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap) case 'd': dst = rn (dst, 10, addsign, va_arg (ap, int), len, pad); break; + case 'D': + dst = rn (dst, 10, addsign, va_arg (ap, long long), len, pad); + break; case 'u': dst = rn (dst, 10, 0, va_arg (ap, int), len, pad); break; + case 'U': + dst = rn (dst, 10, 0, va_arg (ap, long long), len, pad); + break; case 'p': *dst++ = '0'; *dst++ = 'x'; @@ -136,6 +142,9 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap) case 'x': dst = rn (dst, 16, 0, va_arg (ap, int), len, pad); break; + case 'X': + dst = rn (dst, 16, 0, va_arg (ap, long long), len, pad); + break; case 'P': if (!GetModuleFileName (NULL, tmp, MAX_PATH)) s = "cygwin program"; |