summaryrefslogtreecommitdiff
path: root/lib/rts.c
diff options
context:
space:
mode:
authorAlastair Reid2018-06-28 17:39:52 +0100
committerAlastair Reid2018-06-28 17:40:02 +0100
commit3a91534b233ab63fb5ac91ffd92a4d75cc533180 (patch)
tree125cf32e0d68cb20524ac07ca07c99acda247ed9 /lib/rts.c
parent7dc09d0693d042867e73420acd4ff88707dc6da2 (diff)
RTS: Fix utterly broken command line parsing
Diffstat (limited to 'lib/rts.c')
-rw-r--r--lib/rts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rts.c b/lib/rts.c
index dd251eea..23e16921 100644
--- a/lib/rts.c
+++ b/lib/rts.c
@@ -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);