Permalink
Browse files

Patch from Eric Wong to fix segfault

  • Loading branch information...
1 parent 3cfc986 commit c6eaff131d7eddbc23f7cc706ec799360a534281 @mmangino committed Sep 22, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 valconv.h
View
@@ -296,8 +296,9 @@ static VALUE IntUnpack(int *up, unsigned num)
static VALUE unpackfmt = 0;
VALUE buf;
if (unpackfmt == 0) {
- unpackid = rb_intern("unpack");
- unpackfmt = rb_str_new2("i*");
+ unpackid = rb_intern("unpack");
+ unpackfmt = rb_str_new2("i*");
+ rb_global_variable(&unpackfmt);
}
buf = rb_str_new((char *)up, sizeof(int) * num);
return rb_funcall(buf, unpackid, 1, unpackfmt);

0 comments on commit c6eaff1

Please sign in to comment.