summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/printk.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2005-08-12 23:56:16 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2005-08-12 23:56:16 +0000
commitc949d6b0d345e079463f58f721ca14ac68620e7d (patch)
tree706f02aeea4c4b9ca7d86920858d357854ce6adc /cpukit/libcsupport/src/printk.c
parentdb0cf9fc385debffae8777c18b00a74243c1499d (diff)
downloadrtems-c949d6b0d345e079463f58f721ca14ac68620e7d.tar.bz2
2005-08-12 Chris Johns <chrisj@rtems.org>
PR 808/rtems_misc * libcsupport/src/printk.c: Fix bug where specifying field width crashed on pc386 BSP.
Diffstat (limited to '')
-rw-r--r--cpukit/libcsupport/src/printk.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/printk.c b/cpukit/libcsupport/src/printk.c
index 2db31f0bd9..4ce64153b9 100644
--- a/cpukit/libcsupport/src/printk.c
+++ b/cpukit/libcsupport/src/printk.c
@@ -53,10 +53,8 @@ printNum(long unsigned int num, int base, int sign, int maxwidth, int lead)
}
toPrint[count++] = num;
- if (maxwidth) {
- for (n=maxwidth-count ; n ; n-- )
- BSP_output_char(lead);
- }
+ for (n=maxwidth ; n > count; n-- )
+ BSP_output_char(lead);
for (n = 0; n < count; n++){
BSP_output_char("0123456789ABCDEF"[(int)(toPrint[count-(n+1)])]);