changeset 1683:b4a8ef318076

Fix returned length for %p
author gthomas
date Wed, 30 Jun 2004 16:42:56 +0000
parents f240fdd6a1e7
children 3cd6f4cd3db2
files packages/infra/current/ChangeLog packages/infra/current/src/diag.cxx
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/packages/infra/current/ChangeLog
+++ b/packages/infra/current/ChangeLog
@@ -1,3 +1,7 @@
+2004-06-30  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/diag.cxx (_vprintf): Returned [length] was wrong for %p
+
 2004-04-16  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* tests/cxxsupp.cxx: Allow inline function to be correctly inlined.
--- a/packages/infra/current/src/diag.cxx
+++ b/packages/infra/current/src/diag.cxx
@@ -9,7 +9,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-// Copyright (C) 2002 Gary Thomas
+// Copyright (C) 2002, 2004 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
@@ -392,6 +392,7 @@ static int
                 (*putc)('x', param);
                 zero_fill = true;
                 left_prec = sizeof(unsigned long)*2;
+                res += 2;  // Account for "0x" leadin
             case 'd':
             case 'D':
             case 'u':