summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-09-10 15:16:21 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-09-10 19:07:18 +0200
commit94da56269f3b77d6602c383cf06b0ce5987fae4f (patch)
tree5699b49e0060e703b80cc2364b35df8142686fa7 /lib
parent2b99f5e02c3b177375e6641d9a829e39a11431b3 (diff)
downloadcurl-94da56269f3b77d6602c383cf06b0ce5987fae4f.tar.gz
non-ascii: fix build errors from strerror fix
Follow-up to 2f0bb864c12 Closes #7697
Diffstat (limited to 'lib')
-rw-r--r--lib/non-ascii.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/non-ascii.c b/lib/non-ascii.c
index 28398adf1..3b77ae98d 100644
--- a/lib/non-ascii.c
+++ b/lib/non-ascii.c
@@ -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) {