mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
string.c: check argument type
* string.c (rb_str_quote_unprintable): check if argument is a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
10a726d9e3
commit
165db57cdc
2 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Sat May 25 08:58:23 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_quote_unprintable): check if argument is a string.
|
||||
|
||||
Fri May 24 19:32:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||
|
||||
* variable.c (set_const_visibility): use rb_frame_this_func() instead
|
||||
|
|
4
string.c
4
string.c
|
@ -8152,8 +8152,10 @@ rb_str_quote_unprintable(VALUE str)
|
|||
rb_encoding *enc;
|
||||
const char *ptr;
|
||||
long len;
|
||||
rb_encoding *resenc = rb_default_internal_encoding();
|
||||
rb_encoding *resenc;
|
||||
|
||||
Check_Type(str, T_STRING);
|
||||
resenc = rb_default_internal_encoding();
|
||||
if (resenc == NULL) resenc = rb_default_external_encoding();
|
||||
enc = STR_ENC_GET(str);
|
||||
ptr = RSTRING_PTR(str);
|
||||
|
|
Loading…
Add table
Reference in a new issue