diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 06:46:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 06:46:42 +0000 |
commit | 8148b7013c1b08df4fb7bd87bfc699f1f929e540 (patch) | |
tree | 466b40286a32eda2c5329fa753fef330aa9e12fb /io.c | |
parent | 85847e78a0614d1f3373f22811ec6562fc0c2dc5 (diff) | |
download | ruby-8148b7013c1b08df4fb7bd87bfc699f1f929e540.tar.gz |
io.c: check null char
* io.c (ruby_set_inplace_mode): check if null is contained. based
on the patch by tommy (Masahiro Tomita) in [ruby-dev:50272].
[Bug #13960]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -12224,10 +12224,10 @@ argf_inplace_mode_set(VALUE argf, VALUE val) ARGF.inplace = 0; } else { - StringValue(val); + const char *suffix = StringValueCStr(val); if (ARGF.inplace) free(ARGF.inplace); ARGF.inplace = 0; - ARGF.inplace = strdup(RSTRING_PTR(val)); + ARGF.inplace = strdup(suffix); } return argf; } |