Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Patch from Eric Wong to fix segfault

  • Loading branch information...
commit c6eaff131d7eddbc23f7cc706ec799360a534281 1 parent 3cfc986
@mmangino authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 valconv.h
View
5 valconv.h
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.