From 5471c13f65db0e0b8a5ea80c1164a06c5aed1798 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Fri, 14 May 2021 12:22:15 +0200 Subject: [PATCH] Fix signedness warning in glib/gdate.c glib/gdate.c: In function 'win32_strftime_helper': glib/gdate.c:2582:12: warning: comparison of integer expressions of different signedness: 'gsize' {aka 'long long unsigned int'} and 'glong' {aka 'long int'} if (slen <= convlen) ^~ --- glib/gdate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glib/gdate.c b/glib/gdate.c index 59a85c4f6..5feb090c4 100644 --- a/glib/gdate.c +++ b/glib/gdate.c @@ -2588,7 +2588,8 @@ win32_strftime_helper (const GDate *d, return 0; } - if (slen <= convlen) + g_assert (convlen >= 0); + if ((gsize) convlen >= slen) { /* Ensure only whole characters are copied into the buffer. */ gchar *end = g_utf8_find_prev_char (convbuf, convbuf + slen);