Use r_num_math in ragg2 -d,-D

This commit is contained in:
pancake 2014-06-01 05:38:36 +02:00
parent 2233312335
commit a4389ce4ae

View File

@ -146,8 +146,8 @@ int main(int argc, char **argv) {
char *p = strchr (optarg, ':');
if (p) {
*p = 0;
off = r_num_get (NULL, optarg);
n = r_num_get (NULL, p+1);
off = r_num_math (NULL, optarg);
n = r_num_math (NULL, p+1);
*p = ':';
// TODO: honor endianness here
r_egg_patch (egg, off, (const ut8*)&n, 4);
@ -159,8 +159,8 @@ int main(int argc, char **argv) {
ut64 off, n;
char *p = strchr (optarg, ':');
if (p) {
off = r_num_get (NULL, optarg);
n = r_num_get (NULL, p+1);
off = r_num_math (NULL, optarg);
n = r_num_math (NULL, p+1);
// TODO: honor endianness here
r_egg_patch (egg, off, (const ut8*)&n, 8);
} else eprintf ("Missing colon in -d\n");