[glib/glib-2-42] gstrfuncs: Document that g_ascii_dtostr() writes a nul terminator
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-42] gstrfuncs: Document that g_ascii_dtostr() writes a nul terminator
- Date: Thu, 26 Feb 2015 03:49:08 +0000 (UTC)
commit 828a1b082d797729a216a0ee40372f7d0ef9b563
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sun Jan 25 16:22:43 2015 +0000
gstrfuncs: Document that g_ascii_dtostr() writes a nul terminator
And g_ascii_formatd().
Reviewed-by: Ryan Lortie <desrt desrt ca>
glib/gstrfuncs.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index f33f84b..1bae6f9 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -858,7 +858,8 @@ g_ascii_strtod (const gchar *nptr,
* the string back using g_ascii_strtod() gives the same machine-number
* (on machines with IEEE compatible 64bit doubles). It is
* guaranteed that the size of the resulting string will never
- * be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes.
+ * be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes, including the terminating
+ * nul character, which is always added.
*
* Returns: The pointer to the buffer with the converted string.
**/
@@ -886,6 +887,8 @@ g_ascii_dtostr (gchar *buffer,
* a printf()-style format string. Allowed conversion
* specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.
*
+ * The returned buffer is guaranteed to be nul-terminated.
+ *
* If you just want to want to serialize the value into a
* string, use g_ascii_dtostr().
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]