Merge branch 'main' into 'main'

gutf8: add string length check when ending character offset is -1

See merge request GNOME/glib!2328
This commit is contained in:
Philip Withnall
2021-11-22 12:22:54 +00:00
2 changed files with 21 additions and 2 deletions

View File

@@ -128,6 +128,10 @@ test_utf8_substring (void)
r = g_utf8_substring ("abc\xe2\x82\xa0gh\xe2\x82\xa4", 2, 5);
g_assert_cmpstr (r, ==, "c\xe2\x82\xa0g");
g_free (r);
r = g_utf8_substring ("abcd", 1, -1);
g_assert_cmpstr (r, ==, "bcd");
g_free (r);
}
static void