summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 07:20:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 07:20:28 +0000
commit79a85b18cc6ad27f1a70a703270680dc30a1263e (patch)
tree4fbfcaf67c80822fe2ea7b2de20a9c49304aa734 /string.c
parentbfc9c3766f3efd58002bd6e58074c16322abd852 (diff)
string.c: return reallocated pointer
* string.c (str_fill_term): return new pointer reallocated by filling terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 97831e569a..c3fb9b2277 100644
--- a/string.c
+++ b/string.c
@@ -2012,8 +2012,9 @@ str_fill_term(VALUE str, char *s, long len, int termlen)
}
else {
TERM_FILL(s + len, termlen);
+ return s;
}
- return s;
+ return RSTRING_PTR(str);
}
char *