From: Peter Krempa Date: Tue, 12 Mar 2019 12:16:15 +0000 (+0100) Subject: tools: vsh: Don't use assert() X-Git-Tag: v5.2.0-rc1~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae99ca97e657839bbc6b7bb5a5e20a4e87257c9;p=thirdparty%2Flibvirt.git 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 23e0bf1c4eb6 Signed-off-by: Peter Krempa --- diff --git a/tools/vsh.c b/tools/vsh.c index 5e483a5d26..5903f129c1 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -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)