summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 98b9d9aab1..295650e89e 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -65,7 +65,7 @@ strio_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
n = strchr(n, '|');
}
e = strchr(++n, ':');
- len = e ? e - n : strlen(n);
+ len = e ? e - n : (long)strlen(n);
if (len > 0 && len <= ENCODING_MAXNAMELEN) {
if (e) {
memcpy(encname, n, len);