xartigas pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=22b329d2f446468fdd9077ffca1c784ddb39f9c3

commit 22b329d2f446468fdd9077ffca1c784ddb39f9c3
Author: Xavi Artigas <xavierarti...@yahoo.es>
Date:   Mon Sep 16 18:10:09 2019 +0200

    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.
---
 src/lib/elementary/efl_ui_format.c | 9 ++++++---
 1 file 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);

-- 


Reply via email to