From e536047e5e8e54a7dfeca1e9782326e5e0da17a6 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Tue, 10 Sep 2013 22:38:05 -0700 Subject: [PATCH] sigrok-cli: Allow both hex and decimals parameters When strtoll() base parameter is set to 0 it can handle both hex and decimals values. Signed-off-by: Matt Ranostay --- sigrok-cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigrok-cli.c b/sigrok-cli.c index 8521b95..0a5a795 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -977,7 +977,7 @@ static int opts_to_gvar(struct srd_decoder *dec, GHashTable *hash, if (g_variant_is_of_type(o->def, G_VARIANT_TYPE_STRING)) { gvar = g_variant_new_string(val_str); } else if (g_variant_is_of_type(o->def, G_VARIANT_TYPE_INT64)) { - val_int = strtoll(val_str, &conv, 10); + val_int = strtoll(val_str, &conv, 0); if (!conv || conv == val_str) { g_critical("Protocol decoder '%s' option '%s' " "requires a number.", dec->name, o->id); -- 2.30.2