aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-09-16 18:10:09 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-09-16 18:10:09 +0200
commit22b329d2f446468fdd9077ffca1c784ddb39f9c3 (patch)
tree01a8257cc8d37c1b062c49cb200ec3abc1319fa9
parentefl_ui_focus_manager_calc: fix resource leaks (diff)
downloadefl-22b329d2f446468fdd9077ffca1c784ddb39f9c3.tar.gz
efl_ui_format: fix some more harmless Coverity warnings
1403023 Unchecked return value 1403024 Unchecked return value 1403026 Unchecked return value If the eina value conversion fails the default value (0) will be used, which is already a good default. ERRs have been added so the developer has a hint of what is happening.
-rw-r--r--src/lib/elementary/efl_ui_format.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_format.c b/src/lib/elementary/efl_ui_format.c
index 7e3ce115d3..d3cafa1e5a 100644
--- a/src/lib/elementary/efl_ui_format.c
+++ b/src/lib/elementary/efl_ui_format.c
@@ -110,14 +110,16 @@ _do_format_string(Efl_Ui_Format_Data *pd, Eina_Strbuf *str, const Eina_Value val
case FORMAT_TYPE_DOUBLE:
{
double v = 0.0;
- eina_value_double_convert(&value, &v);
+ if (!eina_value_double_convert(&value, &v))
+ ERR("Format conversion failed");
eina_strbuf_append_printf(str, pd->format_string, v);
break;
}
case FORMAT_TYPE_INT:
{
int v = 0;
- eina_value_int_convert(&value, &v);
+ if (!eina_value_int_convert(&value, &v))
+ ERR("Format conversion failed");
eina_strbuf_append_printf(str, pd->format_string, v);
break;
}
@@ -269,7 +271,8 @@ _efl_ui_format_formatted_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Format_Data *pd,
/* Search in the format_values array if we have one */
Efl_Ui_Format_Value val = { 0 };
int ndx;
- eina_value_int_convert(&value, &val.value);
+ if (!eina_value_int_convert(&value, &val.value))
+ ERR("Format conversion failed");
ndx = eina_inarray_search_sorted(pd->format_values, &val, (Eina_Compare_Cb)_value_compare);
if (ndx > -1) {
Efl_Ui_Format_Value *entry = eina_inarray_nth(pd->format_values, ndx);