Fix 32bit chop rnum issue for Windows

This commit is contained in:
pancake 2017-01-05 00:25:45 +01:00
parent 093f77f851
commit 6428a6f4dc
2 changed files with 9 additions and 5 deletions

View File

@ -3512,7 +3512,7 @@ static int cmd_print(void *data, const char *input) {
const ut8 *buf = core->block;
int i = 0;
int j = 0;
if (input[1] == 'A') { // "pca"
if (input[1] == 'A') { // "pcA"
r_cons_printf ("sub_0x%08"PFMT64x":\n", core->offset);
for (i = 0; i < len; i++) {
RAsmOp asmop = {0};

View File

@ -137,11 +137,13 @@ R_API ut64 r_num_get(RNum *num, const char *str) {
ret = str[1] & 0xff;
} else
if (str[0]=='0' && str[1]=='x') {
#if 0
// 32bit chop
#if __WINDOWS__ && MINGW32 && !__CYGWIN__
ret = _strtoui64 (str+2, NULL, 16);
#else
ret = strtoull (str+2, NULL, 16);
#endif
#endif
ret = strtoull (str + 2, NULL, 16);
//sscanf (str+2, "%"PFMT64x, &ret);
} else {
lch = str[len>0?len-1:0];
@ -174,12 +176,14 @@ R_API ut64 r_num_get(RNum *num, const char *str) {
ret *= 1024*1024*1024;
break;
default:
#if 0
//sscanf (str, "%"PFMT64d, &ret);
// 32bit chop
#if __WINDOWS__ && MINGW32 && !__CYGWIN__
ret = _strtoui64 (str, NULL, 10);
#else
ret = strtoull (str, NULL, 10);
#endif
#endif
ret = strtoull (str, NULL, 10);
break;
}
}