diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-06-19 13:48:38 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-06-19 16:04:35 +0300 |
commit | 20807a8c17e629b93d293ef0a0bdbd686ce84823 (patch) | |
tree | d8f0f4fb3ccd359b550b222e4de3c01a5a8d895a | |
parent | b4f3fc1d566b54e4808a5fa854c4fa9ebd160aa1 (diff) |
cam: Support base 16 and base 8 when parsing integer options
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r-- | src/cam/options.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<T>::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 { |