[glib: 2/3] gdate: Use string length when validating UTF-8
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/3] gdate: Use string length when validating UTF-8
- Date: Mon, 21 Dec 2020 17:48:46 +0000 (UTC)
commit fec38762b313c735c6ece54feae3535c9be130c8
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Dec 21 16:50:53 2020 +0000
gdate: Use string length when validating UTF-8
Makes the validation a tiny bit faster.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/gdate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gdate.c b/glib/gdate.c
index 0e03a6e70..253ab6524 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]