summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-08-22 08:14:09 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-08-22 08:14:09 +0900
commitab3b6dbd2ae59838b36f16fed5a635903d9f42a9 (patch)
tree67ba36cbfd4741963d080280abb60fd96b55ef82
parent3f90af6b4263dfc99d513d228a00e62543f22464 (diff)
downloadmruby-ab3b6dbd2ae59838b36f16fed5a635903d9f42a9.tar.gz
mruby-ab3b6dbd2ae59838b36f16fed5a635903d9f42a9.zip
`strlen` returns `size_t`; need to cast before assigning to `int`.
-rw-r--r--src/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.c b/src/string.c
index 7f826ab1d..01d706fa3 100644
--- a/src/string.c
+++ b/src/string.c
@@ -586,7 +586,7 @@ mrb_utf8_from_locale(const char *str, int len)
if (len == 0)
return strdup("");
if (len == -1)
- len = strlen(str);
+ len = (int)strlen(str);
wcssize = MultiByteToWideChar(GetACP(), 0, str, len, NULL, 0);
wcsp = (wchar_t*) malloc((wcssize + 1) * sizeof(wchar_t));
if (!wcsp)
@@ -616,7 +616,7 @@ mrb_locale_from_utf8(const char *utf8, int len)
if (len == 0)
return strdup("");
if (len == -1)
- len = strlen(utf8);
+ len = (int)strlen(utf8);
wcssize = MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0);
wcsp = (wchar_t*) malloc((wcssize + 1) * sizeof(wchar_t));
if (!wcsp)