1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

use idna_strerror() if it is available (only in libidn 0.5.6 or later)

This commit is contained in:
Daniel Stenberg 2004-10-05 08:40:26 +00:00
parent 121197bc87
commit bb999d8213

View 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 */