aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-10-05 08:40:26 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-10-05 08:40:26 +0000
commitbb999d82134b73a500ce7dfecc5b1175930584c2 (patch)
treeef628cb231fa3607ff7afc7699dae57702601c96
parent121197bc8795480c7fea0619cc9f6ce38eb14913 (diff)
use idna_strerror() if it is available (only in libidn 0.5.6 or later)
-rw-r--r--lib/strerror.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/strerror.c b/lib/strerror.c
index b64af1cb8..c9e6c3a18 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -563,11 +563,13 @@ const char *Curl_strerror(struct connectdata *conn, int err)
#ifdef USE_LIBIDN
/*
- * Return error-string for libidn status as returned
- * from idna_to_ascii_lz().
+ * Return error-string for libidn status as returned from idna_to_ascii_lz().
*/
const char *Curl_idn_strerror (struct connectdata *conn, int err)
{
+#ifdef HAVE_IDNA_STRERROR
+ return idna_strerror((Idna_rc) err);
+#else
const char *str;
char *buf;
size_t max;
@@ -623,5 +625,6 @@ const char *Curl_idn_strerror (struct connectdata *conn, int err)
strncpy(buf, str, max);
buf[max] = '\0';
return (buf);
+#endif
}
#endif /* USE_LIBIDN */