From abc49e493d6c1dc47586a7d1b616df5237bd606f Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 14 Jun 2000 05:30:29 +0000 Subject: 2000-06-14 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- struct.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 961475d28f..4d9018a611 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; } -- cgit v1.2.3