[glib: 6/17] gstrfuncs: Document that g_ascii_strncasecmp() stops at first nul byte




commit 535653eec16efa98fefadddd86b613d484aece7d
Author: Philip Withnall <pwithnall endlessos org>
Date:   Sun Mar 14 14:08:56 2021 +0000

    gstrfuncs: Document that g_ascii_strncasecmp() stops at first nul byte
    
    The documentation wasn’t clear about whether it did that, or ignored nul
    bytes and continued to `n` bytes regardless.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 glib/gstrfuncs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index ef6920643..ea710c7a1 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -1874,7 +1874,9 @@ g_ascii_strcasecmp (const gchar *s1,
  * @n: number of characters to compare
  *
  * Compare @s1 and @s2, ignoring the case of ASCII characters and any
- * characters after the first @n in each string.
+ * characters after the first @n in each string. If either string is
+ * less than @n bytes long, comparison will stop at the first nul byte
+ * encountered.
  *
  * Unlike the BSD strcasecmp() function, this only recognizes standard
  * ASCII letters and ignores the locale, treating all non-ASCII


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]