From 0bdd77da976df3fd472a38eeabd1a4fbccecd046 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 3 Jan 2017 17:29:02 +0100 Subject: [PATCH] test if we reached the bottom or top of the enumeration in search for the new value to be set. If we reeach it and it is not set yet, exit the loop. Fixes e.g. ISO=25 being returned by the Sony, but it will be skipped during the setting. fixes https://github.com/gphoto/libgphoto2/issues/124 --- camlibs/ptp2/config.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index a48c7832b..b8d802c1e 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -1329,7 +1329,7 @@ _put_sony_value_##bits (PTPParams*params, uint16_t prop, inttype value,int useen do { \ origval = dpd.CurrentValue.bits; \ /* if it is a ENUM, the camera will walk through the ENUM */ \ - if (useenumorder && (dpd.FormFlag & PTP_DPFF_Enumeration)) { \ + if (useenumorder && (dpd.FormFlag & PTP_DPFF_Enumeration)) { \ int i, posorig = -1, posnew = -1; \ \ for (i=0;i