lib/upnp/Init: use if with initalizer

This commit is contained in:
Max Kellermann 2022-04-26 17:58:32 +02:00
parent 50d35c9677
commit 9659d19718
1 changed files with 1 additions and 3 deletions

View File

@ -35,9 +35,7 @@ static unsigned upnp_ref;
static void
DoInit(const char* iface)
{
auto code = UpnpInit2(iface, 0);
if (code != UPNP_E_SUCCESS)
if (auto code = UpnpInit2(iface, 0); code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpInit() failed: %s",
UpnpGetErrorMessage(code));