diff options
Diffstat (limited to 'lib/non-ascii.c')
-rw-r--r-- | lib/non-ascii.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/non-ascii.c b/lib/non-ascii.c index 932cf89ee..28398adf1 100644 --- a/lib/non-ascii.c +++ b/lib/non-ascii.c @@ -112,11 +112,12 @@ CURLcode Curl_convert_to_network(struct Curl_easy *data, *cd = iconv_open(CURL_ICONV_CODESET_OF_NETWORK, CURL_ICONV_CODESET_OF_HOST); if(*cd == (iconv_t)-1) { + char buffer[STRERROR_LEN]; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_NETWORK, CURL_ICONV_CODESET_OF_HOST, - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } } @@ -128,9 +129,10 @@ CURLcode Curl_convert_to_network(struct Curl_easy *data, if(!data) iconv_close(tmpcd); if((rc == ICONV_ERROR) || (in_bytes)) { + char buffer[STRERROR_LEN]; failf(data, "The Curl_convert_to_network iconv call failed with errno %i: %s", - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } #else @@ -178,11 +180,12 @@ CURLcode Curl_convert_from_network(struct Curl_easy *data, *cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_OF_NETWORK); if(*cd == (iconv_t)-1) { + char buffer[STRERROR_LEN]; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_OF_NETWORK, - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } } @@ -194,9 +197,10 @@ CURLcode Curl_convert_from_network(struct Curl_easy *data, if(!data) iconv_close(tmpcd); if((rc == ICONV_ERROR) || (in_bytes)) { + char buffer[STRERROR_LEN]; failf(data, "Curl_convert_from_network iconv call failed with errno %i: %s", - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } #else @@ -245,11 +249,12 @@ CURLcode Curl_convert_from_utf8(struct Curl_easy *data, *cd = iconv_open(CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_FOR_UTF8); if(*cd == (iconv_t)-1) { + char buffer[STRERROR_LEN]; failf(data, "The iconv_open(\"%s\", \"%s\") call failed with errno %i: %s", CURL_ICONV_CODESET_OF_HOST, CURL_ICONV_CODESET_FOR_UTF8, - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } } @@ -261,9 +266,10 @@ CURLcode Curl_convert_from_utf8(struct Curl_easy *data, if(!data) iconv_close(tmpcd); if((rc == ICONV_ERROR) || (in_bytes)) { + char buffer[STRERROR_LEN]; failf(data, "The Curl_convert_from_utf8 iconv call failed with errno %i: %s", - errno, strerror(errno)); + errno, Curl_strerror(errno, buffer, sizeof(buffer))); return CURLE_CONV_FAILED; } if(output_ptr < input_ptr) { |