[glib: 1/3] Fix comparison of unsigned expression < 0 is always false warning in glib/gunicollate.c




commit 6d8caf648256394fdf2a62703bac590735330196
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date:   Sat May 8 10:14:10 2021 +0200

    Fix comparison of unsigned expression < 0 is always false warning in glib/gunicollate.c
    
    glib/gunicollate.c:444:17: warning: comparison of unsigned expression < 0 is always false
              if (xfrm_len < 0 || xfrm_len >= G_MAXINT - 2)
                  ~~~~~~~~ ^ ~

 glib/gunicollate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gunicollate.c b/glib/gunicollate.c
index d54ef19ed..dfed1041d 100644
--- a/glib/gunicollate.c
+++ b/glib/gunicollate.c
@@ -441,7 +441,7 @@ g_utf8_collate_key (const gchar *str,
       if (str_locale)
        {
          xfrm_len = strxfrm (NULL, str_locale, 0);
-         if (xfrm_len < 0 || xfrm_len >= G_MAXINT - 2)
+         if (xfrm_len >= G_MAXINT - 2)
            {
              g_free (str_locale);
              str_locale = NULL;


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