From b3c54696f8fd0cabdee2c796eb48b13e13752cbe Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Sun, 8 Jan 2006 15:41:56 +0000 Subject: [PATCH] fix printing pointers git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@450 7ec92016-0320-0410-acc4-a06ded1c099a --- CHANGES | 16 +++++++++------- include/loki/SafeFormat.h | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 53f43db..81d72ef 100755 --- a/CHANGES +++ b/CHANGES @@ -7,8 +7,8 @@ _____________________________________ General: - LockPtr added (rs) - ScopeGuard added (pk,rs) - - improved Makefiles (Thanks to Lukas Fittl, pk) - - several gcc fixes and removed warnings by Lukas Fittl + - improved Makefiles (lf,pk) + - several gcc fixes and removed warnings by Lukas Fittl (lf) - tested on 64-bit Linux (pk) - MS Visual C++ project files added (pk) - now also the ms toolkit 2003 generates a library (pk) @@ -17,12 +17,13 @@ OrderedStatic: - point operator added (pk) SafeFormat: - - moved into namespace Loki - - %p test disabled due to platform dependent problems (pk) - - speed comparison added (pk) + - moved into namespace Loki (pk) - 64 bit problems fixed (Thanks to Zak Kipling) - ported to 64-bit Windows, not tested (pk) - - Printf/SPrintfing of std::strings added + - Printf/SPrintfing of std::strings added (pk) + - all warnings removed gcc and msvc (pk) + - use snprintf for "p" + - test program: speed comparison added (pk) SmallObject: - added functions to check for memory corruption (rs) @@ -51,7 +52,8 @@ ScopeGuard: - example added (pk) -CVS commits by Rich Sposato (rs) and Peter Kümmel (pk) +CVS commits by Rich Sposato (rs), Lukas Fittl (lf) +and Peter Kümmel (pk) _____________________________________ diff --git a/include/loki/SafeFormat.h b/include/loki/SafeFormat.h index b0ffd95..950557d 100755 --- a/include/loki/SafeFormat.h +++ b/include/loki/SafeFormat.h @@ -142,19 +142,19 @@ namespace Loki PrintfState& operator()(void* n) { if (result_ == -1) return *this; // don't even bother - PrintUsing_printf(n,"p"); + PrintUsing_snprintf(n,"p"); return *this; } PrintfState& operator()(double n) { if (result_ == -1) return *this; // don't even bother - PrintUsing_printf(n,"eEfgG"); + PrintUsing_snprintf(n,"eEfgG"); return *this; } PrintfState& operator()(long double n) { if (result_ == -1) return *this; // don't even bother - PrintUsing_printf(n,"eEfgG"); + PrintUsing_snprintf(n,"eEfgG"); return *this; } @@ -328,7 +328,7 @@ namespace Loki } template - void PrintUsing_printf(Value n, const char* check_fmt_char) { + void PrintUsing_snprintf(Value n, const char* check_fmt_char) { const Char *const fmt = format_ - 1; assert(*fmt == '%'); // enforce format string validity