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

non-ascii: use iconv() with 'char **' argument

Bug: https://curl.haxx.se/mail/lib-2017-09/0031.html
This commit is contained in:
Daniel Stenberg 2017-09-08 09:22:01 +02:00
parent 2fc1db56cd
commit 46e14b6942
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -119,7 +119,7 @@ CURLcode Curl_convert_to_network(struct Curl_easy *data,
/* call iconv */ /* call iconv */
input_ptr = output_ptr = buffer; input_ptr = output_ptr = buffer;
in_bytes = out_bytes = length; in_bytes = out_bytes = length;
rc = iconv(*cd, (const char **)&input_ptr, &in_bytes, rc = iconv(*cd, &input_ptr, &in_bytes,
&output_ptr, &out_bytes); &output_ptr, &out_bytes);
if(!data) if(!data)
iconv_close(tmpcd); iconv_close(tmpcd);
@ -182,7 +182,7 @@ CURLcode Curl_convert_from_network(struct Curl_easy *data,
/* call iconv */ /* call iconv */
input_ptr = output_ptr = buffer; input_ptr = output_ptr = buffer;
in_bytes = out_bytes = length; in_bytes = out_bytes = length;
rc = iconv(*cd, (const char **)&input_ptr, &in_bytes, rc = iconv(*cd, &input_ptr, &in_bytes,
&output_ptr, &out_bytes); &output_ptr, &out_bytes);
if(!data) if(!data)
iconv_close(tmpcd); iconv_close(tmpcd);
@ -224,7 +224,7 @@ CURLcode Curl_convert_from_utf8(struct Curl_easy *data,
/* do the translation ourselves */ /* do the translation ourselves */
iconv_t tmpcd = (iconv_t) -1; iconv_t tmpcd = (iconv_t) -1;
iconv_t *cd = &tmpcd; iconv_t *cd = &tmpcd;
const char *input_ptr; char *input_ptr;
char *output_ptr; char *output_ptr;
size_t in_bytes, out_bytes, rc; size_t in_bytes, out_bytes, rc;