Exemple #1
0
VALUE
ossl_buf2str(char *buf, int len)
{
    VALUE str;

    str = ossl_str_new(len);
    if(!NIL_P(str)) memcpy(RSTRING_PTR(str), buf, len);
    OPENSSL_free(buf);

    return str;
}
Exemple #2
0
VALUE
ossl_buf2str(char *buf, int len)
{
    VALUE str;
    int state;

    str = ossl_str_new(buf, len, &state);
    OPENSSL_free(buf);
    if (state)
	rb_jump_tag(state);
    return str;
}