From: Matt Ranostay Date: Wed, 11 Sep 2013 05:38:05 +0000 (-0700) Subject: sigrok-cli: Allow both hex and decimals parameters X-Git-Tag: sigrok-cli-0.5.0~83 X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=e536047e5e8e54a7dfeca1e9782326e5e0da17a6 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 --- 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);