summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-06-19 13:48:38 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-06-19 16:04:35 +0300
commit20807a8c17e629b93d293ef0a0bdbd686ce84823 (patch)
treed8f0f4fb3ccd359b550b222e4de3c01a5a8d895a /src
parentb4f3fc1d566b54e4808a5fa854c4fa9ebd160aa1 (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>
Diffstat (limited to 'src')
-rw-r--r--src/cam/options.cpp2
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 {