mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-28 00:16:15 +01:00
Fixing signedness problem in glib/gstrfuncs.c
glib/gstrfuncs.c: In function ‘g_strstr_len’: glib/gstrfuncs.c:2709:24: error: comparison of integer expressions of different signedness: ‘gssize’ {aka ‘long int’} and ‘gsize’ {aka ‘long unsigned int’} [-Werror=sign-compare] if (haystack_len < needle_len) ^
This commit is contained in:
parent
81a4698c45
commit
592d4369d4
@ -2700,13 +2700,14 @@ g_strstr_len (const gchar *haystack,
|
||||
{
|
||||
const gchar *p = haystack;
|
||||
gsize needle_len = strlen (needle);
|
||||
gsize haystack_len_unsigned = haystack_len;
|
||||
const gchar *end;
|
||||
gsize i;
|
||||
|
||||
if (needle_len == 0)
|
||||
return (gchar *)haystack;
|
||||
|
||||
if (haystack_len < needle_len)
|
||||
if (haystack_len_unsigned < needle_len)
|
||||
return NULL;
|
||||
|
||||
end = haystack + haystack_len - needle_len;
|
||||
|
Loading…
Reference in New Issue
Block a user