提交 eae99ca9 编写于 作者: P Peter Krempa

tools: vsh: Don't use assert()

It's meant for testing, not for production builds. Also we have a helper
for reporting OOM errors. Introduced by 23e0bf1cSigned-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 2c0b8d6a
......@@ -385,7 +385,7 @@ vshCmddefCheckInternals(vshControl *ctl,
}
if ((p = strchr(name, '=')) &&
VIR_STRNDUP(name, name, p - name) < 0)
assert(false); /* Allocation failure during self-test is bad */
vshErrorOOM();
for (j = i + 1; cmd->opts[j].name; j++) {
if (STREQ(name, cmd->opts[j].name) &&
cmd->opts[j].type != VSH_OT_ALIAS)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册