From 20807a8c17e629b93d293ef0a0bdbd686ce84823 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 19 Jun 2019 13:48:38 +0300 Subject: cam: Support base 16 and base 8 when parsing integer options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Integer options have to use base 10. This isn't user-friendly when specifying pixel formats. Detect the base automatically to support base 16. As a side effect, integer values starting with 0 will be interpreted in base 8. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cam/options.cpp b/src/cam/options.cpp index bea4a600..7c3948df 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -79,7 +79,7 @@ bool OptionsBase::parseValue(const T &opt, const Option &option, if (optarg) { char *endptr; - integer = strtoul(optarg, &endptr, 10); + integer = strtoul(optarg, &endptr, 0); if (*endptr != '\0') return false; } else { -- cgit v1.2.1