msvcrt: Fix scanf to correctly parse pointers on 64-bit.
This commit is contained in:
parent
4b9bba163e
commit
3a195139c2
|
@ -151,6 +151,8 @@ _FUNCTION_ {
|
||||||
switch(*format) {
|
switch(*format) {
|
||||||
case 'p':
|
case 'p':
|
||||||
case 'P': /* pointer. */
|
case 'P': /* pointer. */
|
||||||
|
if (sizeof(void *) == sizeof(LONGLONG)) I64_prefix = 1;
|
||||||
|
/* fall through */
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'X': /* hexadecimal integer. */
|
case 'X': /* hexadecimal integer. */
|
||||||
base = 16;
|
base = 16;
|
||||||
|
@ -224,7 +226,7 @@ _FUNCTION_ {
|
||||||
if (!suppress) {
|
if (!suppress) {
|
||||||
#define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur
|
#define _SET_NUMBER_(type) *va_arg(ap, type*) = negative ? -cur : cur
|
||||||
if (I64_prefix) _SET_NUMBER_(LONGLONG);
|
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 if (h_prefix) _SET_NUMBER_(short int);
|
||||||
else _SET_NUMBER_(int);
|
else _SET_NUMBER_(int);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue