Skip to content

Commit

Permalink
Merge pull request openssl#343 from rhenium/ky/ssl-avoid-mixed-declar…
Browse files Browse the repository at this point in the history
…ations

ssl: avoid declarations after statements
  • Loading branch information
rhenium committed Feb 19, 2020
2 parents 85b5e23 + 0c4066a commit ad379a2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ext/openssl/ossl_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2327,16 +2327,16 @@ static VALUE
ossl_ssl_get_finished(VALUE self)
{
SSL *ssl;
char sizer[1], *buf;
size_t len;

GetSSL(self, ssl);

char sizer[1];
size_t len = SSL_get_finished(ssl, sizer, 0);

if(len == 0)
return Qnil;
len = SSL_get_finished(ssl, sizer, 0);
if (len == 0)
return Qnil;

char* buf = ALLOCA_N(char, len);
buf = ALLOCA_N(char, len);
SSL_get_finished(ssl, buf, len);
return rb_str_new(buf, len);
}
Expand All @@ -2352,16 +2352,16 @@ static VALUE
ossl_ssl_get_peer_finished(VALUE self)
{
SSL *ssl;
char sizer[1], *buf;
size_t len;

GetSSL(self, ssl);

char sizer[1];
size_t len = SSL_get_peer_finished(ssl, sizer, 0);

if(len == 0)
return Qnil;
len = SSL_get_peer_finished(ssl, sizer, 0);
if (len == 0)
return Qnil;

char* buf = ALLOCA_N(char, len);
buf = ALLOCA_N(char, len);
SSL_get_peer_finished(ssl, buf, len);
return rb_str_new(buf, len);
}
Expand Down

0 comments on commit ad379a2

Please sign in to comment.