summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-06-06 05:01:41 +0000
committermarcel <marcel@FreeBSD.org>2007-06-06 05:01:41 +0000
commit1094a6916bea7a5dc727f1786045aa2ea706b6e5 (patch)
tree4cc243502c41e9409a5c5735fa8add2826c56fea /sys
parentd82da159d3303099ba08eab3f1c1bd4b8fbbb7a1 (diff)
downloadFreeBSD-src-1094a6916bea7a5dc727f1786045aa2ea706b6e5.zip
FreeBSD-src-1094a6916bea7a5dc727f1786045aa2ea706b6e5.tar.gz
Call sbuf_finish() before sbuf_data() and sbuf_len().
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/part/g_part.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index d9a2319..b79923e 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -426,6 +426,7 @@ g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_printf(sb, "%s%s added\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
+ sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
}
@@ -603,6 +604,7 @@ g_part_ctl_create(struct gctl_req *req, struct g_part_parms *gpp)
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_printf(sb, "%s created\n", gp->name);
+ sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
}
@@ -670,6 +672,7 @@ g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_printf(sb, "%s%s deleted\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
+ sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
}
@@ -724,6 +727,7 @@ g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp)
if (gpp->gpp_parms & G_PART_PARM_OUTPUT) {
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_printf(sb, "%s destroyed\n", gp->name);
+ sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
}
@@ -771,6 +775,7 @@ g_part_ctl_modify(struct gctl_req *req, struct g_part_parms *gpp)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_printf(sb, "%s%s modified\n", gp->name,
G_PART_NAME(table, entry, buf, sizeof(buf)));
+ sbuf_finish(sb);
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
}
OpenPOWER on IntegriCloud