summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-14 05:30:29 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-14 05:30:29 +0000
commitabc49e493d6c1dc47586a7d1b616df5237bd606f (patch)
treedb7b8cc8d3495baf10d4e3d9c3f899233231d629 /struct.c
parent00e9a8f0c33d8c7e384041e2bcce6d28d3450bb8 (diff)
2000-06-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/struct.c b/struct.c
index 961475d..4d9018a 100644
--- a/struct.c
+++ b/struct.c
@@ -496,12 +496,14 @@ rb_struct_aset(s, idx, val)
i = NUM2LONG(idx);
if (i < 0) i = RSTRUCT(s)->len + i;
- if (i < 0)
+ if (i < 0) {
rb_raise(rb_eIndexError, "offset %d too small for struct(size:%d)",
i, RSTRUCT(s)->len);
- if (RSTRUCT(s)->len <= i)
+ }
+ if (RSTRUCT(s)->len <= i) {
rb_raise(rb_eIndexError, "offset %d too large for struct(size:%d)",
i, RSTRUCT(s)->len);
+ }
if (OBJ_FROZEN(s)) rb_error_frozen("Struct");
return RSTRUCT(s)->ptr[i] = val;
}