summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
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 1114577729..790e185b63 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