xbps_dbg_printf{,_append}: return if xhp is NULL.

assert() here was totally wrong, better to catch
this in all cases (NDEBUG does not change the behaviour).
This commit is contained in:
Juan RP 2020-01-11 09:48:38 +01:00
parent 6cf1555398
commit feece576b3
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -56,7 +56,8 @@ xbps_dbg_printf_append(struct xbps_handle *xhp, const char *fmt, ...)
{
va_list ap;
assert(xhp);
if (!xhp)
return;
if ((xhp->flags & XBPS_FLAG_DEBUG) == 0)
return;
@ -71,7 +72,8 @@ xbps_dbg_printf(struct xbps_handle *xhp, const char *fmt, ...)
{
va_list ap;
assert(xhp);
if (!xhp)
return;
if ((xhp->flags & XBPS_FLAG_DEBUG) == 0)
return;