summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-01-05 04:41:21 +0000
commit56e60da9db31c4b6ec8d6433be9710470daaf34a (patch)
treece7e90b3c16ce6246be9850c9b1ea1328992c0e7 /struct.c
parentc3f7c758488c87d12a779345c567f1b4b5e910b0 (diff)
downloadruby-56e60da9db31c4b6ec8d6433be9710470daaf34a.tar.gz
ruby-56e60da9db31c4b6ec8d6433be9710470daaf34a.tar.xz
ruby-56e60da9db31c4b6ec8d6433be9710470daaf34a.zip
20000105
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/struct.c b/struct.c
index 111457772..790e185b6 100644
--- a/struct.c
+++ b/struct.c
@@ -407,14 +407,14 @@ static VALUE
rb_struct_clone(s)
VALUE s;
{
- NEWOBJ(st, struct RStruct);
- CLONESETUP(st, s);
- st->len = 0; /* avoid GC crashing */
- st->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
- st->len = RSTRUCT(s)->len;
- MEMCPY(st->ptr, RSTRUCT(s)->ptr, VALUE, st->len);
-
- return (VALUE)st;
+ NEWOBJ(clone, struct RStruct);
+ CLONESETUP(clone, s);
+ clone->len = 0; /* avoid GC crashing */
+ clone->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
+ clone->len = RSTRUCT(s)->len;
+ MEMCPY(clone->ptr, RSTRUCT(s)->ptr, VALUE, clone->len);
+
+ return (VALUE)clone;
}
static VALUE