summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-24 13:54:37 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-11-25 12:58:00 -0600
commitebb39a216d8c26929e1228181f0a4a02088c2b8a (patch)
treeb531773507d25c577fa9ccceaff0156f8bed46b6
parentmain_edit.c: Do not reference beyond end of array (diff)
downloadrtems-ebb39a216d8c26929e1228181f0a4a02088c2b8a.tar.bz2
hexdump-conv.c: Use proper printf() formatting for wchar_t
-rw-r--r--cpukit/libmisc/shell/hexdump-conv.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpukit/libmisc/shell/hexdump-conv.c b/cpukit/libmisc/shell/hexdump-conv.c
index 44390baa32..95d8a87974 100644
--- a/cpukit/libmisc/shell/hexdump-conv.c
+++ b/cpukit/libmisc/shell/hexdump-conv.c
@@ -142,7 +142,15 @@ retry:
pad = 3 - width;
if (pad < 0)
pad = 0;
- (void)printf("%*s%lc", pad, "", wc);
+ #if defined(__rtems__)
+ {
+ wchar_t wc_tmp[2] = {0,0};
+ wc_tmp[0] = wc;
+ (void)printf("%*s%lc", pad, "", wc_tmp);
+ }
+ #else
+ (void)printf("%*s%lc", pad, "", wc);
+ #endif
pr->mbleft = clen - 1;
}
} else {