aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/string.c b/string.c
index e4308be0f5..a273400d89 100644
--- a/string.c
+++ b/string.c
@@ -614,12 +614,7 @@ rb_str_cat(str, ptr, len)
if (FL_TEST(str, STR_ASSOC)) {
rb_str_modify(str);
REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len+len);
- if (ptr) {
- memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
- }
- else {
- MEMZERO(RSTRING(str)->ptr + RSTRING(str)->len, char, len);
- }
+ memcpy(RSTRING(str)->ptr + RSTRING(str)->len, ptr, len);
RSTRING(str)->len += len;
RSTRING(str)->ptr[RSTRING(str)->len] = '\0'; /* sentinel */
return str;
@@ -3076,7 +3071,7 @@ rb_str_intern(str)
rb_raise(rb_eArgError, "interning empty string");
}
if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
- rb_raise(rb_eArgError, "string contains `\\0'");
+ rb_raise(rb_eArgError, "symbol string may not contain `\\0'");
id = rb_intern(RSTRING(str)->ptr);
return ID2SYM(id);
}