summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2005-08-12 23:55:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2005-08-12 23:55:14 +0000
commit5c12a265fa43401524b1a9eb6424a871ff2aa4a4 (patch)
treeb0ad95b8b9507ca96fb5bb5a3e3e5f4f7ecd6967
parent2005-08-12 Phil Torre <ptorre@zetron.com> (diff)
downloadrtems-5c12a265fa43401524b1a9eb6424a871ff2aa4a4.tar.bz2
2005-08-12 Chris Johns <chrisj@rtems.org>
PR 808/rtems_misc * src/printk.c: Fix bug where specifying field width crashed on pc386 BSP.
-rw-r--r--cpukit/libcsupport/ChangeLog6
-rw-r--r--cpukit/libcsupport/src/printk.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog
index d8db01618e..4f196b2706 100644
--- a/cpukit/libcsupport/ChangeLog
+++ b/cpukit/libcsupport/ChangeLog
@@ -1,3 +1,9 @@
+2005-08-12 Chris Johns <chrisj@rtems.org>
+
+ PR 808/rtems_misc
+ * src/printk.c: Fix bug where specifying field width crashed on pc386
+ BSP.
+
2005-08-02 Ralf Corsepius <ralf.corsepius@rtems.org>
PR 817/rtems
diff --git a/cpukit/libcsupport/src/printk.c b/cpukit/libcsupport/src/printk.c
index c227bd79d0..cd5dbc4418 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)])]);