summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/pack.c b/pack.c
index cf348947f1..b22a8348b2 100644
--- a/pack.c
+++ b/pack.c
@@ -1884,8 +1884,8 @@ pack_unpack(str, fmt)
case 'P':
if (sizeof(char *) <= send - s) {
+ VALUE tmp = Qnil;
char *t;
- VALUE tmp;
memcpy(&t, s, sizeof(char *));
s += sizeof(char *);
@@ -1915,9 +1915,6 @@ pack_unpack(str, fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- else {
- tmp = Qnil;
- }
rb_ary_push(ary, tmp);
}
break;
@@ -1929,7 +1926,7 @@ pack_unpack(str, fmt)
if (send - s < sizeof(char *))
break;
else {
- VALUE tmp;
+ VALUE tmp = Qnil;
char *t;
memcpy(&t, s, sizeof(char *));
@@ -1954,9 +1951,6 @@ pack_unpack(str, fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- else {
- tmp = Qnil;
- }
rb_ary_push(ary, tmp);
}
}