@@ -1182,14 +1182,22 @@ arv_device_set_features_from_string (ArvDevice *device, const char *string, GErr
11821182 ARV_DEVICE_ERROR_INVALID_PARAMETER ,
11831183 "Invalid address in %s" , key );
11841184 } else {
1185- int_value = g_ascii_strtoll (value , & end , 0 );
1186- if (end == NULL || end [0 ] != '\0' ) {
1185+ if (value == NULL || strlen (value ) == 0 ) {
11871186 g_set_error (& local_error ,
11881187 ARV_DEVICE_ERROR ,
11891188 ARV_DEVICE_ERROR_INVALID_PARAMETER ,
1190- "Invalid %s value for %s" , value , key );
1189+ "Value not found for %s" , key );
11911190 } else {
1192- arv_device_write_register (device , address , int_value , & local_error );
1191+ int_value = g_ascii_strtoll (value , & end , 0 );
1192+ if (end == NULL || end [0 ] != '\0' ) {
1193+ g_set_error (& local_error ,
1194+ ARV_DEVICE_ERROR ,
1195+ ARV_DEVICE_ERROR_INVALID_PARAMETER ,
1196+ "Invalid %s value for %s" , value , key );
1197+ } else {
1198+ arv_device_write_register (device , address , int_value ,
1199+ & local_error );
1200+ }
11931201 }
11941202 }
11951203 } else {
0 commit comments