From 58e4a067430a8f9187155f50e117dc3150595dd5 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 11 Mar 2016 07:24:39 +0000 Subject: idn_win32: Use boolean based success codes Rather than use 0 and 1 integer base result codes use a FALSE / TRUE based success code. --- lib/url.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 218929d53..0894bae8b 100644 --- a/lib/url.c +++ b/lib/url.c @@ -75,7 +75,7 @@ void idn_free (void *ptr); #endif #elif defined(USE_WIN32_IDN) /* prototype for curl_win32_idn_to_ascii() */ -int curl_win32_idn_to_ascii(const char *in, char **out); +bool curl_win32_idn_to_ascii(const char *in, char **out); #endif /* USE_LIBIDN */ #include "urldata.h" @@ -3803,15 +3803,14 @@ static void fix_hostname(struct SessionHandle *data, * Check name for non-ASCII and convert hostname to ACE form. *************************************************************/ char *ace_hostname = NULL; - int rc = curl_win32_idn_to_ascii(host->name, &ace_hostname); - if(rc == 0) - infof(data, "Failed to convert %s to ACE;\n", - host->name); - else { + + if(curl_win32_idn_to_ascii(host->name, &ace_hostname)) { host->encalloc = ace_hostname; /* change the name pointer to point to the encoded hostname */ host->name = host->encalloc; } + else + infof(data, "Failed to convert %s to ACE;\n", host->name); #else infof(data, "IDN support not present, can't parse Unicode domains\n"); #endif -- cgit v1.2.3