From f8f4a9446550f2da7f1dc1892f780aacc7115ec3 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sun, 9 Feb 2020 04:37:52 +0000 Subject: [PATCH] url: Include the failure reason when curl_win32_idn_to_ascii() fails Provide the failure reason in the failf() info just as we do for the libidn2 version of code. Closes #4899 --- lib/url.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/url.c b/lib/url.c index 07d429e35..f3b26dafa 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1514,7 +1514,9 @@ static CURLcode idnconvert_hostname(struct connectdata *conn, host->name = host->encalloc; } else { - failf(data, "Failed to convert %s to ACE;\n", host->name); + char buffer[STRERROR_LEN]; + failf(data, "Failed to convert %s to ACE; %s\n", host->name, + Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer))); return CURLE_URL_MALFORMAT; } #else