1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

util: error: Fix error message strings to play well with additional info

Additional information for an error message is either in form of a
string or empty. Fix two offenders. One used %d as the format modifier
and the second one  always expected a string.

Thankfully, neither of the offenders are currently in effect.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Peter Krempa 2018-11-12 15:30:21 +01:00
parent 590cc60de5
commit 759bb2110e

View File

@ -975,7 +975,10 @@ virErrorMsg(virErrorNumber error, const char *info)
errmsg = _("POST operation failed");
break;
case VIR_ERR_HTTP_ERROR:
errmsg = _("got unknown HTTP error code %d");
if (info != NULL)
errmsg = _("got unknown HTTP error code %s");
else
errmsg = _("got unknown HTTP error code");
break;
case VIR_ERR_UNKNOWN_HOST:
if (info != NULL)
@ -1002,7 +1005,10 @@ virErrorMsg(virErrorNumber error, const char *info)
errmsg = _("could not connect to Xen Store %s");
break;
case VIR_ERR_XEN_CALL:
errmsg = _("failed Xen syscall %s");
if (info == NULL)
errmsg = _("failed Xen syscall");
else
errmsg = _("failed Xen syscall %s");
break;
case VIR_ERR_OS_TYPE:
if (info == NULL)