Piotr Caban : msvcrt: Use pf_integer_conv when displaying pointers.

Alexandre Julliard julliard at winehq.org
Wed Apr 27 12:47:27 CDT 2011


Module: wine
Branch: master
Commit: 8e58cbd8cb312dd22efd578d2b4ca856042f2d54
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8e58cbd8cb312dd22efd578d2b4ca856042f2d54

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Apr 27 12:09:37 2011 +0200

msvcrt: Use pf_integer_conv when displaying pointers.

---

 dlls/msvcrt/printf.h |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h
index c3884ab..93a8d43 100644
--- a/dlls/msvcrt/printf.h
+++ b/dlls/msvcrt/printf.h
@@ -478,13 +478,14 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
 
             i = FUNC_NAME(pf_handle_string)(pf_puts, puts_ctx, &ch, 1, &flags, locale);
         } else if(flags.Format == 'p') {
-            void *ptr = pf_args(args_ctx, pos, VT_PTR, &valist).get_ptr;
-
+            flags.Format = 'X';
+            flags.PadZero = '0';
+            i = flags.Precision;
+            flags.Precision = 2*sizeof(void*);
+            FUNC_NAME(pf_integer_conv)(buf, sizeof(buf), &flags,
+                    pf_args(args_ctx, pos, VT_INT, &valist).get_int);
             flags.PadZero = 0;
-            if(flags.Alternate)
-                sprintf(buf, "0X%0*lX", 2*(int)sizeof(ptr), (ULONG_PTR)ptr);
-            else
-                sprintf(buf, "%0*lX", 2*(int)sizeof(ptr), (ULONG_PTR)ptr);
+            flags.Precision = i;
 
             i = FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, buf, -1, &flags, locale);
         } else if(flags.Format == 'n') {




More information about the wine-cvs mailing list