Skip to content

Commit a9612cf

Browse files
committed
bcrypt_ext: Add compatibility with libxcrypt
1 parent f2db689 commit a9612cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎ext/mri/bcrypt_ext.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static VALUE bc_salt(VALUE self, VALUE prefix, VALUE count, VALUE input) {
1818

1919
if(!salt) return Qnil;
2020

21-
str_salt = rb_str_new2(salt);
21+
str_salt = rb_str_new(salt, strlen(salt));
2222
xfree(salt);
2323

2424
return str_salt;
@@ -45,7 +45,7 @@ static VALUE bc_crypt(VALUE self, VALUE key, VALUE setting) {
4545

4646
if(!value) return Qnil;
4747

48-
out = rb_str_new(data, size - 1);
48+
out = rb_str_new(value, strlen(value));
4949

5050
xfree(data);
5151

0 commit comments

Comments
 (0)