1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/stringio] Suppress a sign-compare warning

https://github.com/ruby/stringio/commit/a88c070e0b
This commit is contained in:
Nobuyoshi Nakada 2021-07-08 16:38:08 +09:00
parent 3b36e34b90
commit 771f6dd75d
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -65,7 +65,7 @@ strio_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
n = strchr(n, '|'); n = strchr(n, '|');
} }
e = 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 (len > 0 && len <= ENCODING_MAXNAMELEN) {
if (e) { if (e) {
memcpy(encname, n, len); memcpy(encname, n, len);