summaryrefslogtreecommitdiff
path: root/camlibs
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2021-09-25 15:41:41 +0200
committerMarcus Meissner <marcus@jet.franken.de>2021-09-25 15:41:41 +0200
commit25ae9a3760a682644c76db2c7cf433f48cfbeab4 (patch)
treea4ed06f9e138c8d4d1d8961dc9c63a186ed4e6a9 /camlibs
parent961ca419010b8fe66d831298991b0a749ae7f4c7 (diff)
downloadlibgphoto2-25ae9a3760a682644c76db2c7cf433f48cfbeab4.tar.gz
check for errors from widget functions
Diffstat (limited to 'camlibs')
-rw-r--r--camlibs/ptp2/config.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c
index 1c4024179..88697374f 100644
--- a/camlibs/ptp2/config.c
+++ b/camlibs/ptp2/config.c
@@ -11463,22 +11463,22 @@ camera_lookup_by_property(Camera *camera, PTPDevicePropDesc *dpd, char **name, c
GP_LOG_E ("Widget get of property '%s' failed, trying to see if we have another...", cursub->label);
continue;
}
- ret = gp_widget_get_name (widget, (const char**)name);
+ CR (gp_widget_get_name (widget, (const char**)name));
*name = strdup(*name);
- ret = gp_widget_get_type (widget, &type);
+ CR (gp_widget_get_type (widget, &type));
switch (type) {
case GP_WIDGET_RADIO:
case GP_WIDGET_MENU:
case GP_WIDGET_TEXT: {
char *val;
- gp_widget_get_value (widget, &val);
+ CR (gp_widget_get_value (widget, &val));
*content = strdup(val);
break;
}
case GP_WIDGET_RANGE: {
char buf[20];
float fval;
- gp_widget_get_value (widget, &fval);
+ CR (gp_widget_get_value (widget, &fval));
sprintf(buf,"%f",fval);
*content = strdup(buf);
break;
@@ -11503,22 +11503,22 @@ camera_lookup_by_property(Camera *camera, PTPDevicePropDesc *dpd, char **name, c
GP_LOG_D ("Failed to parse value of property '%s' / 0x%04x: error code %d", cursub->label, cursub->propid, ret);
continue;
}
- ret = gp_widget_get_name (widget, (const char**)name);
+ CR (gp_widget_get_name (widget, (const char**)name));
*name = strdup(*name);
- ret = gp_widget_get_type (widget, &type);
+ CR (gp_widget_get_type (widget, &type));
switch (type) {
case GP_WIDGET_RADIO:
case GP_WIDGET_MENU:
case GP_WIDGET_TEXT: {
char *val;
- gp_widget_get_value (widget, &val);
+ CR (gp_widget_get_value (widget, &val));
*content = strdup(val);
break;
}
case GP_WIDGET_RANGE: {
char buf[20];
float fval;
- gp_widget_get_value (widget, &fval);
+ CR (gp_widget_get_value (widget, &fval));
sprintf(buf,"%f",fval);
*content = strdup(buf);
break;
@@ -11541,22 +11541,22 @@ camera_lookup_by_property(Camera *camera, PTPDevicePropDesc *dpd, char **name, c
GP_LOG_D ("Failed to parse value of property '%s' / 0x%04x: error code %d", cursub->label, cursub->propid, ret);
continue;
}
- ret = gp_widget_get_name (widget, (const char**)name);
+ CR (gp_widget_get_name (widget, (const char**)name));
*name = strdup(*name);
- ret = gp_widget_get_type (widget, &type);
+ CR (gp_widget_get_type (widget, &type));
switch (type) {
case GP_WIDGET_RADIO:
case GP_WIDGET_MENU:
case GP_WIDGET_TEXT: {
char *val;
- gp_widget_get_value (widget, &val);
- *content = strdup(val);
+ CR (gp_widget_get_value (widget, &val));
+ *content = strdup(val?val:"NULL");
break;
}
case GP_WIDGET_RANGE: {
char buf[20];
float fval;
- gp_widget_get_value (widget, &fval);
+ CR (gp_widget_get_value (widget, &fval));
sprintf(buf,"%f",fval);
*content = strdup(buf);
break;