From 249921347826456f81b3a8ab5dd5c1605e0e0b72 Mon Sep 17 00:00:00 2001 From: aryajur Date: Wed, 23 Sep 2015 23:57:26 -0700 Subject: [PATCH] Made compatible with Lua 5.3 and removed a warning when compiling about unused variable len. --- src/lcrypto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lcrypto.c b/src/lcrypto.c index 48364d1..419b77e 100644 --- a/src/lcrypto.c +++ b/src/lcrypto.c @@ -968,7 +968,7 @@ static int verify_fverify(lua_State *L) static int rand_do_bytes(lua_State *L, int (*bytes)(unsigned char *, int)) { - size_t count = (size_t)luaL_checkint(L, 1); + size_t count = (size_t)luaL_checkinteger(L, 1); unsigned char tmp[256], *buf = tmp; if (count > sizeof tmp) buf = (unsigned char *)malloc(count); @@ -1157,7 +1157,7 @@ static int pkey_to_pem(lua_State *L) struct evp_pkey_st *pkey_st = *pkey; int ret; - long len; + //long len; BUF_MEM *buf; BIO *mem = BIO_new(BIO_s_mem()); @@ -1176,7 +1176,8 @@ static int pkey_to_pem(lua_State *L) goto error; } - len = BIO_get_mem_ptr(mem, &buf); + //len = BIO_get_mem_ptr(mem, &buf); + BIO_get_mem_ptr(mem, &buf); lua_pushlstring(L, buf->data, buf->length); ret = 1;