]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
use idna_strerror() if it is available (only in libidn 0.5.6 or later)
authorDaniel Stenberg <daniel@haxx.se>
Tue, 5 Oct 2004 08:40:26 +0000 (08:40 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Oct 2004 08:40:26 +0000 (08:40 +0000)
lib/strerror.c

index b64af1cb842f4808cc8d2fbd81087fb3e3fd80f4..c9e6c3a186265c571ac1427bd1d5a20f2ac6e814 100644 (file)
@@ -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 */