summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-04-29 05:53:25 -0400
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-04-29 05:53:25 -0400
commitf7c756c214b0b10baebdb02af25b983438dcda83 (patch)
treeae8054e066812c6752848070c8b788fba47b6cee /src/tools
parent8cb9e90732090520afa0e1e918bd1c7dd7dafee2 (diff)
unidasm: Allow hexadecimal values for -skip with 0x prefix
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/unidasm.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index c668fcba82d..c437b260c8d 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -975,7 +975,12 @@ static int parse_options(int argc, char *argv[], options *opts)
// skip bytes
else if(pending_skip) {
- if(sscanf(curarg, "%d", &opts->skip) != 1)
+ int result;
+ if(curarg[0] == '0' && curarg[1] == 'x')
+ result = sscanf(&curarg[2], "%x", &opts->skip);
+ else
+ result = sscanf(curarg, "%d", &opts->skip);
+ if(result != 1)
goto usage;
pending_skip = false;
}