aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-03-11 07:24:39 +0000
committerSteve Holme <steve_holme@hotmail.com>2016-03-11 07:24:39 +0000
commit58e4a067430a8f9187155f50e117dc3150595dd5 (patch)
tree7deb66cb1f621d67c652ed8f5036862b4df0834f /lib/url.c
parentb0841739898ad458230382a9b3abab360130d233 (diff)
idn_win32: Use boolean based success codes
Rather than use 0 and 1 integer base result codes use a FALSE / TRUE based success code.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c11
1 files changed, 5 insertions, 6 deletions
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