From 777460c2261bcc07a9cea56d916d93793c7b3742 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 12 Nov 2020 23:24:19 +0000 Subject: [PATCH] Fix C11 conformance Ellipsis in variadic macro requires at least 1 argument --- libmariadb/secure/schannel_certs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libmariadb/secure/schannel_certs.c b/libmariadb/secure/schannel_certs.c index a393c1c8..88fefa1d 100644 --- a/libmariadb/secure/schannel_certs.c +++ b/libmariadb/secure/schannel_certs.c @@ -63,12 +63,12 @@ static DWORD get_last_error() return ERROR_INTERNAL_ERROR; } -#define FAIL(fmt,...) \ - {\ - status = get_last_error();\ - ma_format_win32_error(errmsg, errmsg_len, status, fmt, __VA_ARGS__);\ - goto cleanup;\ - } +#define FAIL(...) \ + do{\ + status = get_last_error();\ + ma_format_win32_error(errmsg, errmsg_len, status, __VA_ARGS__);\ + goto cleanup;\ + } while (0) /* Load file into memory. Add null terminator at the end, so it will be a valid C string. @@ -654,7 +654,7 @@ static SECURITY_STATUS load_private_key(CERT_CONTEXT* cert, char* private_key_st derbuf = LocalAlloc(0, derlen); if (!derbuf) { - FAIL("LocalAlloc failed") + FAIL("LocalAlloc failed"); } if (!CryptStringToBinaryA(private_key_str, (DWORD)len, CRYPT_STRING_BASE64HEADER, derbuf, &derlen, NULL, NULL))