From 3a195139c24647633f2c9213cd893465392b7b94 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 6 Apr 2009 20:58:10 +0200 Subject: [PATCH] msvcrt: Fix scanf to correctly parse pointers on 64-bit. --- dlls/msvcrt/scanf.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/scanf.h b/dlls/msvcrt/scanf.h index 6ea9ab1ca81..3eb705b2376 100644 --- a/dlls/msvcrt/scanf.h +++ b/dlls/msvcrt/scanf.h @@ -151,6 +151,8 @@ _FUNCTION_ { switch(*format) { case 'p': case 'P': /* pointer. */ + if (sizeof(void *) == sizeof(LONGLONG)) I64_prefix = 1; + /* fall through */ case 'x': case 'X': /* hexadecimal integer. */ base = 16; @@ -224,7 +226,7 @@ _FUNCTION_ { if (!suppress) { #define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur if (I64_prefix) _SET_NUMBER_(LONGLONG); - else if (l_prefix) _SET_NUMBER_(long int); + else if (l_prefix) _SET_NUMBER_(LONG); else if (h_prefix) _SET_NUMBER_(short int); else _SET_NUMBER_(int); } -- 2.11.4.GIT