gdate: Use string length when validating UTF-8

Makes the validation a tiny bit faster.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2020-12-21 16:50:53 +00:00
parent 3fc314ec38
commit 59999737c9

View File

@ -1243,7 +1243,7 @@ g_date_set_parse (GDate *d,
return;
/* The input has to be valid UTF-8. */
if (!g_utf8_validate (str, -1, NULL))
if (!g_utf8_validate_len (str, str_len, NULL))
return;
G_LOCK (g_date_global);