Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-07-30 01:42:10 +0400
committerChristopher Faylor <me@cgf.cx>2012-07-30 01:42:10 +0400
commitab6596266fc616cbe235bb919349f22ff9a75aba (patch)
tree2fd8ade076215a4bc40b07a76c59b9414858c6ab /winsup/cygwin/smallprint.cc
parentc5b9032e48450d513e91c4befd8b3c0702a525f8 (diff)
Add missing file from last checkin.
Diffstat (limited to 'winsup/cygwin/smallprint.cc')
-rw-r--r--winsup/cygwin/smallprint.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
index e7a9f530f..fa7706b47 100644
--- a/winsup/cygwin/smallprint.cc
+++ b/winsup/cygwin/smallprint.cc
@@ -146,7 +146,17 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
l_opt = true;
continue;
case 'c':
- *dst++ = (char) (va_arg (ap, int) & 0xff);
+ {
+ unsigned char c = (va_arg (ap, int) & 0xff);
+ if (isprint (c) || pad != '0')
+ *dst++ = c;
+ else
+ {
+ *dst++ = '0';
+ *dst++ = 'x';
+ dst = __rn (dst, 16, 0, c, len, pad, LMASK);
+ }
+ }
break;
case 'C':
{