Alexandre Julliard : msvcrt: Fix scanf to correctly parse pointers on 64-bit.
Alexandre Julliard
julliard at winehq.org
Tue Apr 7 09:04:37 CDT 2009
Module: wine
Branch: master
Commit: 3a195139c24647633f2c9213cd893465392b7b94
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a195139c24647633f2c9213cd893465392b7b94
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Apr 6 20:58:10 2009 +0200
msvcrt: Fix scanf to correctly parse pointers on 64-bit.
---
dlls/msvcrt/scanf.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/scanf.h b/dlls/msvcrt/scanf.h
index 6ea9ab1..3eb705b 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);
}
More information about the wine-cvs
mailing list