aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 503ff174ac..561aa90400 100644
--- a/hash.c
+++ b/hash.c
@@ -2971,7 +2971,7 @@ get_env_cstr(
if (memchr(var, '\0', RSTRING_LEN(str))) {
rb_raise(rb_eArgError, "bad environment variable %s: contains null byte", name);
}
- return var;
+ return rb_str_fill_terminator(str, 1); /* ASCII compatible */
}
#ifdef _WIN32