[glib/glib-2-66: 2/3] gdate: Use string length when validating UTF-8




commit 59999737c9980e3c3ea84a7320dd17f5499501ef
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]