summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2001-12-12 22:05:55 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2001-12-12 22:05:55 +0000
commita99e75d0a8345b21c4132ece9b3510a38ae30e1d (patch)
tree6c4c06cbf9362dd1a7f4a12a9a2a3542829e1225 /docs
parent3fa33317b7e9866793ce1ea32d069e8c9270caa2 (diff)
This fixes #60543:
* glib/gutils.c (g_snprintf, g_vsnprintf): Switch to C99-[v]snprintf(). * tests/strfunc-test.c: Add some tests for g_snprintf().
Diffstat (limited to 'docs')
-rw-r--r--docs/reference/ChangeLog4
-rw-r--r--docs/reference/glib/tmpl/string_utils.sgml34
2 files changed, 32 insertions, 6 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index cc38554b4..191959ffd 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,5 +1,9 @@
2001-12-12 Matthias Clasen <matthiasc@poet.de>
+ * glib/tmpl/string_utils.sgml: Correct docs for g_[v]snprintf.
+
+2001-12-12 Matthias Clasen <matthiasc@poet.de>
+
* glib/tmpl/allocators.sgml, glib/tmpl/arrays.sgml,
glib/tmpl/arrays_byte.sgml, glib/tmpl/arrays_pointer.sgml,
glib/tmpl/caches.sgml, glib/tmpl/completion.sgml,
diff --git a/docs/reference/glib/tmpl/string_utils.sgml b/docs/reference/glib/tmpl/string_utils.sgml
index 1955df837..16ebaaca7 100644
--- a/docs/reference/glib/tmpl/string_utils.sgml
+++ b/docs/reference/glib/tmpl/string_utils.sgml
@@ -173,17 +173,28 @@ See also g_strdup_printf().
<note>
<para>
In versions of GLib prior to 1.2.3, this function may return -1 if the output
-was truncated, and the truncated string may not be nul-terminated.
+was truncated, and the truncated string may not be nul-terminated.
+In versions prior to 1.3.12, this function returns the length of the output
+string.
+</para>
+</note>
+<note>
+<para>
+The return value of g_snprintf() conforms to the <function>snprintf()</function>
+function as standardized in ISO C99. Note that this is different from
+traditional <function>snprintf()</function>, which returns the length of
+the output string.
</para>
</note>
@string: the buffer to hold the output.
-@n: the maximum number of characters to produce (including the terminating null
+@n: the maximum number of characters to produce (including the terminating nul
character).
-@format: the format string. See the <function>sprintf()</function>
+@format: the format string. See the <function>sprintf()</function>.
documentation.
@Varargs: the arguments to insert in the output.
-@Returns: the length of the output string.
+@Returns: the number of characters which would be produced if the buffer was
+large enough.
<!-- ##### FUNCTION g_vsnprintf ##### -->
@@ -200,16 +211,27 @@ See also g_strdup_vprintf().
<para>
In versions of GLib prior to 1.2.3, this function may return -1 if the output
was truncated, and the truncated string may not be nul-terminated.
+In versions prior to 1.3.12, this function returns the length of the output
+string.
+</para>
+</note>
+<note>
+<para>
+The return value of g_vsnprintf() conforms to the <function>vsnprintf()</function>
+function as standardized in ISO C99. Note that this is different from
+traditional <function>vsnprintf()</function>, which returns the length of
+the output string.
</para>
</note>
@string: the buffer to hold the output.
-@n: the maximum number of characters to produce (including the terminating null
+@n: the maximum number of characters to produce (including the terminating nul
character).
@format: the format string. See the <function>sprintf()</function>
documentation.
@args: the list of arguments to insert in the output.
-@Returns: the length of the output string.
+@Returns: the number of characters which would be produced if the buffer was
+large enough.
<!-- ##### FUNCTION g_printf_string_upper_bound ##### -->