[glib] Documentation improvement



commit dd7bd61c5301f92408ccb420a5bbd094faa863c3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 21 16:04:21 2010 -0500

    Documentation improvement
    
    Document the size requirements on output buffer in g_base64_encode_close.
    Patch by Christian Persch, bug 609564.

 glib/gbase64.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/glib/gbase64.c b/glib/gbase64.c
index 23d4ebf..59a911a 100644
--- a/glib/gbase64.c
+++ b/glib/gbase64.c
@@ -185,14 +185,18 @@ g_base64_encode_step (const guchar *in,
  *
  * Flush the status from a sequence of calls to g_base64_encode_step().
  *
+ * The output buffer must be large enough to fit all the data that will
+ * be written to it. It will need up to 4 bytes, or up to 5 bytes if
+ * line-breaking is enabled.
+ *
  * Return value: The number of bytes of output that was written
  *
  * Since: 2.12
  */
 gsize
 g_base64_encode_close (gboolean  break_lines,
-		       gchar    *out, 
-		       gint     *state, 
+		       gchar    *out,
+		       gint     *state,
 		       gint     *save)
 {
   int c1, c2;



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