diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h index 1e860eb790..5a0a27cda5 100644 --- a/ext/json/fbuffer/fbuffer.h +++ b/ext/json/fbuffer/fbuffer.h @@ -181,7 +181,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;