Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jan 2012 10:54:26 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r230054 - stable/9/share/man/man9
Message-ID:  <201201131054.q0DAsQO1059119@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Fri Jan 13 10:54:26 2012
New Revision: 230054
URL: http://svn.freebsd.org/changeset/base/230054

Log:
  MFC r228358:
  
  - Fix markup.
  - Remove trailing whitespace.
  
  MFC r228359:
  
  sbuf_data() hasn't returned NULL for overflowed buffers since r71721.
  
  MFC r228784:
  
  Follow style(9) more closely in the example.

Modified:
  stable/9/share/man/man9/sbuf.9
Directory Properties:
  stable/9/share/man/man9/   (props changed)

Modified: stable/9/share/man/man9/sbuf.9
==============================================================================
--- stable/9/share/man/man9/sbuf.9	Fri Jan 13 10:21:17 2012	(r230053)
+++ stable/9/share/man/man9/sbuf.9	Fri Jan 13 10:54:26 2012	(r230054)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2011
+.Dd December 21, 2011
 .Dt SBUF 9
 .Os
 .Sh NAME
@@ -117,7 +117,7 @@ defined in
 .Pp
 Any errors encountered during the allocation or composition of the
 string will be latched in the data structure,
-making a single error test at the end of the composition 
+making a single error test at the end of the composition
 sufficient to determine success or failure of the entire process.
 .Pp
 The
@@ -391,7 +391,8 @@ function returns the actual string;
 only works on a finished
 .Fa sbuf .
 The
-.Fn sbuf_len function returns the length of the string.
+.Fn sbuf_len
+function returns the length of the string.
 For an
 .Fa sbuf
 with an attached drain,
@@ -462,12 +463,8 @@ function returns a non-zero value if the
 drain error, and zero otherwise.
 .Pp
 The
-.Fn sbuf_data
-and
 .Fn sbuf_len
-functions return
-.Dv NULL
-and \-1, respectively, if the buffer overflowed.
+function returns \-1 if the buffer overflowed.
 .Pp
 The
 .Fn sbuf_copyin
@@ -482,7 +479,7 @@ being finished,
 or returns the error code from the drain if one is attached.
 .Pp
 The
-.Fn sbuf_finish 3 
+.Fn sbuf_finish 3
 function (the userland version)
 will return zero for success and \-1 and set errno on error.
 .Sh EXAMPLES
@@ -498,8 +495,8 @@ TAILQ_FOREACH(foo, &foolist, list) {
 	sbuf_printf(sb, "      Address: %s\en", foo->address);
 	sbuf_printf(sb, "      Zip: %s\en", foo->zipcode);
 }
-if (sbuf_finish(sb)) /* Check for any and all errors */
-	err(1,"Could not generate message");
+if (sbuf_finish(sb) != 0) /* Check for any and all errors */
+	err(1, "Could not generate message");
 transmit_msg(sbuf_data(sb), sbuf_len(sb));
 sbuf_delete(sb);
 .Ed



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201131054.q0DAsQO1059119>