svn commit: r222095 - head/share/man/man9
Poul-Henning Kamp
phk at FreeBSD.org
Thu May 19 13:42:20 UTC 2011
Author: phk
Date: Thu May 19 13:42:19 2011
New Revision: 222095
URL: http://svn.freebsd.org/changeset/base/222095
Log:
When adding examples to man-pages, try to make them at least
look like they might work.
Prodded by: Vadim Goncharov
Modified:
head/share/man/man9/sbuf.9
Modified: head/share/man/man9/sbuf.9
==============================================================================
--- head/share/man/man9/sbuf.9 Thu May 19 13:09:39 2011 (r222094)
+++ head/share/man/man9/sbuf.9 Thu May 19 13:42:19 2011 (r222095)
@@ -492,13 +492,13 @@ will return zero for success and \-1 and
struct sbuf *sb;
sb = sbuf_new_auto();
-sbuf_cat("Customers found:\en");
+sbuf_cat(sb, "Customers found:\en");
TAILQ_FOREACH(foo, &foolist, list) {
- sbuf_printf(" %4d %s\en", foo->index, foo->name);
- sbuf_printf(" Address: %s\en", foo->address);
- sbuf_printf(" Zip: %s\en", foo->zipcode);
+ sbuf_printf(sb, " %4d %s\en", foo->index, foo->name);
+ sbuf_printf(sb, " Address: %s\en", foo->address);
+ sbuf_printf(sb, " Zip: %s\en", foo->zipcode);
}
-if (sbuf_finish(sb))
+if (sbuf_finish(sb)) /* Check for any and all errors */
err(1,"Could not generate message");
transmit_msg(sbuf_data(sb), sbuf_len(sb));
sbuf_delete(sb);
More information about the svn-src-head
mailing list