[glib: 4/10] Fixing signedness in digest_to_string:glib/gchecksum.c



commit b8efd0df4172f202b1cbda92a436419af14dd9c7
Author: Emmanuel Fleury <emmanuel fleury u-bordeaux fr>
Date:   Sat Jan 26 16:41:09 2019 +0100

    Fixing signedness in digest_to_string:glib/gchecksum.c
    
    glib/gchecksum.c: In function ‘digest_to_string’:
    glib/gchecksum.c:186:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka 
‘int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare]
       for (i = 0; i < digest_len; i++)
                     ^

 glib/gchecksum.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/glib/gchecksum.c b/glib/gchecksum.c
index 5530aad2f..f55a871ba 100644
--- a/glib/gchecksum.c
+++ b/glib/gchecksum.c
@@ -177,8 +177,7 @@ static gchar *
 digest_to_string (guint8 *digest,
                   gsize   digest_len)
 {
-  gint len = digest_len * 2;
-  gint i;
+  gsize i, len = digest_len * 2;
   gchar *retval;
 
   retval = g_new (gchar, len + 1);


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