Skip to content

Instantly share code, notes, and snippets.

@apolloclark
Last active March 11, 2016 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apolloclark/7cd9703f899fb0de997b to your computer and use it in GitHub Desktop.
Save apolloclark/7cd9703f899fb0de997b to your computer and use it in GitHub Desktop.
diff --git a/ext/json/ext/fbuffer/fbuffer.h b/ext/json/ext/fbuffer/fbuffer.h
index af74187..9524fb1 100644
--- a/ext/json/ext/fbuffer/fbuffer.h
+++ b/ext/json/ext/fbuffer/fbuffer.h
@@ -172,7 +172,7 @@ static FBuffer *fbuffer_dup(FBuffer *fb)
static VALUE fbuffer_to_s(FBuffer *fb)
{
- VALUE result = rb_str_new(FBUFFER_PAIR(fb));
+ VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));
fbuffer_free(fb);
FORCE_UTF8(result);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment