提交 4838e8b3 编写于 作者: J Ján Tomko

Use virBufferTrimLen when applicable

Replace all the cases that only supply the length
and do not care about matching a suffix, as well
as that one test case that does.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 08040554
......@@ -215,7 +215,7 @@ static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef,
virBufferAdd(&buf, ttyPaths[i] + 5, -1);
virBufferAddChar(&buf, ' ');
}
virBufferTrim(&buf, NULL, 1);
virBufferTrimLen(&buf, 1);
virUUIDFormat(vmDef->uuid, uuidstr);
......
......@@ -108,9 +108,9 @@ static int testBufTrim(const void *data G_GNUC_UNUSED)
virBufferAddLit(buf, "a;");
virBufferTrim(buf, "", 0);
virBufferTrim(buf, "", -1);
virBufferTrim(buf, NULL, 1);
virBufferTrim(buf, NULL, 5);
virBufferTrim(buf, "a", 2);
virBufferTrimLen(buf, 1);
virBufferTrimLen(buf, 5);
virBufferTrimLen(buf, 2);
virBufferAddLit(buf, ",b,,");
virBufferTrim(buf, NULL, -1);
......
......@@ -2525,7 +2525,7 @@ vshTreePrintInternal(vshControl *ctl,
vshPrint(ctl, "%s\n", virBufferCurrentContent(indent));
if (!root)
virBufferTrim(indent, NULL, 2);
virBufferTrimLen(indent, 2);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册