From c2868be90d0f1f43ee13bacdb1c0f55a9fe34276 Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Wed, 18 Jul 2012 13:38:50 +0000 Subject: [PATCH] add the alignment display for signed integer git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2220 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- src/kservice.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/kservice.c b/src/kservice.c index a49cc377e9..8e2cf38336 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -15,6 +15,7 @@ * 2010-03-17 Bernard remove rt_strlcpy function * fix gcc compiling issue. * 2010-04-15 Bernard remove weak definition on ICCM16C compiler + * 2012-07-18 Arda add the alignment display for signed integer */ #include @@ -590,6 +591,9 @@ static char *print_number(char *buf, char *end, long num, int base, int s, int t if (!(type&(ZEROPAD | LEFT))) { + if ((sign)&&(size>0)) + size--; + while (size-->0) { if (buf <= end)