1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-01-18 10:30:37 +00:00

Allow $XX hex notation

This commit is contained in:
Peter Evans 2018-02-26 14:21:20 -06:00
parent 5bb76164dc
commit fec8ef0743

View File

@ -95,6 +95,12 @@ vm_debug_addr(const char *str)
return -1; return -1;
} }
// We do accept the $XX notation for hexadecimals; it's easy to do,
// since we can just skip past that part of the string.
if (*str == '$') {
str++;
}
addr = strtol(str, NULL, 16); addr = strtol(str, NULL, 16);
if (addr == 0 && errno == EINVAL) { if (addr == 0 && errno == EINVAL) {
return -1; return -1;