mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
non-ascii: fix build errors from strerror fix
Follow-up to 2f0bb864c1
Closes #7697
This commit is contained in:
parent
2b99f5e02c
commit
94da56269f
@ -31,6 +31,7 @@
|
||||
#include "sendf.h"
|
||||
#include "urldata.h"
|
||||
#include "multiif.h"
|
||||
#include "strerror.h"
|
||||
|
||||
#include "curl_memory.h"
|
||||
/* The last #include file should be: */
|
||||
@ -104,6 +105,7 @@ CURLcode Curl_convert_to_network(struct Curl_easy *data,
|
||||
iconv_t *cd = &tmpcd;
|
||||
char *input_ptr, *output_ptr;
|
||||
size_t in_bytes, out_bytes, rc;
|
||||
char ebuffer[STRERROR_LEN];
|
||||
|
||||
/* open an iconv conversion descriptor if necessary */
|
||||
if(data)
|
||||
@ -112,12 +114,11 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
}
|
||||
@ -129,10 +130,9 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
#else
|
||||
@ -172,6 +172,7 @@ CURLcode Curl_convert_from_network(struct Curl_easy *data,
|
||||
iconv_t *cd = &tmpcd;
|
||||
char *input_ptr, *output_ptr;
|
||||
size_t in_bytes, out_bytes, rc;
|
||||
char ebuffer[STRERROR_LEN];
|
||||
|
||||
/* open an iconv conversion descriptor if necessary */
|
||||
if(data)
|
||||
@ -180,12 +181,11 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
}
|
||||
@ -197,10 +197,9 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
#else
|
||||
@ -241,6 +240,7 @@ CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
|
||||
char *input_ptr;
|
||||
char *output_ptr;
|
||||
size_t in_bytes, out_bytes, rc;
|
||||
char ebuffer[STRERROR_LEN];
|
||||
|
||||
/* open an iconv conversion descriptor if necessary */
|
||||
if(data)
|
||||
@ -249,12 +249,11 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
}
|
||||
@ -266,10 +265,9 @@ 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, Curl_strerror(errno, buffer, sizeof(buffer)));
|
||||
errno, Curl_strerror(errno, ebuffer, sizeof(ebuffer)));
|
||||
return CURLE_CONV_FAILED;
|
||||
}
|
||||
if(output_ptr < input_ptr) {
|
||||
|
Loading…
Reference in New Issue
Block a user