[evolution-data-server] I#418 - locale_supports_12_hour_format() can read uninitialized value



commit 3463dee92f08c6d9089c87f946599605567b94aa
Author: Milan Crha <mcrha redhat com>
Date:   Thu Sep 29 09:08:43 2022 +0200

    I#418 - locale_supports_12_hour_format() can read uninitialized value
    
    Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/418

 src/libedataserver/e-time-utils.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libedataserver/e-time-utils.c b/src/libedataserver/e-time-utils.c
index 79dba7d0e..ab5de804e 100644
--- a/src/libedataserver/e-time-utils.c
+++ b/src/libedataserver/e-time-utils.c
@@ -1599,13 +1599,15 @@ locale_supports_12_hour_format (void)
        tmp_tm.tm_wday = 6;
        tmp_tm.tm_yday = 6;
 
-       e_utf8_strftime (s, sizeof (s), "%p", &tmp_tm);
+       if (!e_utf8_strftime (s, sizeof (s), "%p", &tmp_tm))
+               s[0] = '\0';
 
        if (!s[0]) {
                tmp_tm.tm_hour = 13;
                tmp_tm.tm_min = 0;
 
-               e_utf8_strftime (s, sizeof (s), "%p", &tmp_tm);
+               if (!e_utf8_strftime (s, sizeof (s), "%p", &tmp_tm))
+                       s[0] = '\0';
        }
 
        return s[0] != '\0';


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]