diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-07-26 16:57:42 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-07-28 22:17:53 +0900 |
commit | af04e2692422e63edf0666daad4def52aac65141 (patch) | |
tree | ee3fd294b740c3afd9f4f307e11a82ea751c7ae2 /string.c | |
parent | 7cfabe1acc55b24fc2c479a87efa71cf74e9e8fc (diff) |
Fill terminator properly
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -5148,7 +5148,9 @@ rb_str_drop_bytes(VALUE str, long len) } STR_SET_LEN(str, nlen); - ptr[nlen] = 0; + if (!SHARABLE_MIDDLE_SUBSTRING) { + TERM_FILL(ptr + nlen, TERM_LEN(str)); + } ENC_CODERANGE_CLEAR(str); return str; } |