[glib: 9/11] Fix signedness warning in gio/gdbusdaemon.c:is_key()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 9/11] Fix signedness warning in gio/gdbusdaemon.c:is_key()
- Date: Tue, 19 Jan 2021 10:24:23 +0000 (UTC)
commit 6d08c2f5ba6d5bbaf6805008d022cc0409414de3
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Tue Nov 17 11:23:47 2020 +0100
Fix signedness warning in gio/gdbusdaemon.c:is_key()
gio/gdbusdaemon.c: In function ‘is_key’:
gio/gdbusdaemon.c:213:11: error: comparison of integer expressions of different signedness: ‘gsize’ {aka
‘long unsigned int’} and ‘long int’
213 | if (len != key_end - key_start)
| ^~
gio/gdbusdaemon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gio/gdbusdaemon.c b/gio/gdbusdaemon.c
index 7ae55ece8..f62b5ce0e 100644
--- a/gio/gdbusdaemon.c
+++ b/gio/gdbusdaemon.c
@@ -210,7 +210,8 @@ is_key (const char *key_start, const char *key_end, const char *value)
{
gsize len = strlen (value);
- if (len != key_end - key_start)
+ g_assert (key_end >= key_start);
+ if (len != (gsize) (key_end - key_start))
return FALSE;
return strncmp (key_start, value, len) == 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]