stefan pushed a commit to branch master.

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

commit bc52776fd621e91fb013fbe31c0a5fdc0da3b20d
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Apr 16 10:44:03 2020 -0400

    eina/value: use correct time types when comparing time types
    
    these functions all expect struct timeval, as the name implies
    
    ../src/lib/eina/eina_value.c: In function ‘_eina_value_type_tm_compare’:
    ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside 
array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds]
     3358 |    struct timeval ret = *input;
          |                   ^~~
    ../src/lib/eina/eina_value.c:3569:11: note: while referencing ‘ta’
     3569 |    time_t ta, tb;
          |           ^~
    ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside 
array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds]
     3358 |    struct timeval ret = *input;
          |                   ^~~
    ../src/lib/eina/eina_value.c:3569:15: note: while referencing ‘tb’
     3569 |    time_t ta, tb;
    
    Reviewed-by: Stefan Schmidt <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11715
---
 src/lib/eina/eina_value.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index c18f369006..b71fa7da96 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -3567,11 +3567,14 @@ _eina_value_type_tm_compare(const Eina_Value_Type 
*type, const void *a, const vo
    struct tm tma = *(struct tm*)a;
    struct tm tmb = *(struct tm*)b;
    time_t ta, tb;
+   struct timeval tva = {0}, tvb = {0};
 
    ta = mktime(&tma);
    tb = mktime(&tmb);
+   tva.tv_sec = ta;
+   tvb.tv_sec = tb;
 
-   return _eina_value_type_timeval_compare(type, &ta, &tb);
+   return _eina_value_type_timeval_compare(type, &tva, &tvb);
 }
 
 static Eina_Bool

-- 


Reply via email to