diff --git a/ext/mri/bcrypt_ext.c b/ext/mri/bcrypt_ext.c index 13f5e4e..b2edd1d 100644 --- a/ext/mri/bcrypt_ext.c +++ b/ext/mri/bcrypt_ext.c @@ -45,7 +45,7 @@ static VALUE bc_crypt(VALUE self, VALUE key, VALUE setting) { if(!value) return Qnil; - out = rb_str_new(data, size - 1); + out = rb_str_new2(value); xfree(data);