diff options
| author | Alastair Reid | 2018-06-28 17:39:52 +0100 |
|---|---|---|
| committer | Alastair Reid | 2018-06-28 17:40:02 +0100 |
| commit | 3a91534b233ab63fb5ac91ffd92a4d75cc533180 (patch) | |
| tree | 125cf32e0d68cb20524ac07ca07c99acda247ed9 /lib/rts.c | |
| parent | 7dc09d0693d042867e73420acd4ff88707dc6da2 (diff) | |
RTS: Fix utterly broken command line parsing
Diffstat (limited to 'lib/rts.c')
| -rw-r--r-- | lib/rts.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -467,9 +467,11 @@ int process_arguments(int argc, char *argv[]) case 'C': { char arg[100]; uint64_t value; - if (sscanf(optarg, "%99[a-zA-Z0-9_-.]=%" PRId64, arg, &value)) { + if (sscanf(optarg, "%99[a-zA-Z0-9_-.]=0x%" PRIx64, arg, &value) == 2) { + // fprintf(stderr, "Got hex flag %s %" PRIx64 "\n", arg, value); // do nothing - } else if (sscanf(optarg, "%99[a-zA-Z0-9_.]=0x%" PRIx64, arg, &value)) { + } else if (sscanf(optarg, "%99[a-zA-Z0-9_-.]=%" PRId64, arg, &value) == 2) { + // fprintf(stderr, "Got decimal flag %s %" PRIx64 "\n", arg, value); // do nothing } else { fprintf(stderr, "Could not parse argument %s\n", optarg); |
