summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/curl_multibyte.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2018-12-14 03:33:12 +0300
committerdartraiden <wowemuh@gmail.com>2018-12-14 03:33:29 +0300
commitfff280ec7c91e7bbba1f8dd389468717f08e9106 (patch)
treeae20777655e2814dd5ab9be0e456a472065e62ce /libs/libcurl/src/curl_multibyte.c
parent887544273011d56a796e9507199ea8d6484d31c6 (diff)
libcurl: update to 7.63
Diffstat (limited to 'libs/libcurl/src/curl_multibyte.c')
-rw-r--r--libs/libcurl/src/curl_multibyte.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/libcurl/src/curl_multibyte.c b/libs/libcurl/src/curl_multibyte.c
index e78bb5002e..e48334faff 100644
--- a/libs/libcurl/src/curl_multibyte.c
+++ b/libs/libcurl/src/curl_multibyte.c
@@ -64,13 +64,13 @@ char *Curl_convert_wchar_to_UTF8(const wchar_t *str_w)
char *str_utf8 = NULL;
if(str_w) {
- int str_utf8_len = WideCharToMultiByte(CP_UTF8, 0, str_w, -1, NULL,
- 0, NULL, NULL);
- if(str_utf8_len > 0) {
- str_utf8 = malloc(str_utf8_len * sizeof(wchar_t));
+ int bytes = WideCharToMultiByte(CP_UTF8, 0, str_w, -1,
+ NULL, 0, NULL, NULL);
+ if(bytes > 0) {
+ str_utf8 = malloc(bytes);
if(str_utf8) {
- if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, str_utf8_len,
- NULL, FALSE) == 0) {
+ if(WideCharToMultiByte(CP_UTF8, 0, str_w, -1, str_utf8, bytes,
+ NULL, NULL) == 0) {
free(str_utf8);
return NULL;
}