aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-ossl/0005-pkey.new-opt-rename-variable.patch
blob: fbbb163c1e3cd20c65f2d8b3bdd22f1bc7eb07b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 31403e7892b554458edc28a43f6f0552f3f27bac Mon Sep 17 00:00:00 2001
From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
Date: Sun, 2 Sep 2018 14:24:51 +0300
Subject: [PATCH 05/10] pkey.new: opt: rename variable

---
 src/openssl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/openssl.c b/src/openssl.c
index ed18e60..5904bf1 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -4301,20 +4301,20 @@ static int pk_new(lua_State *L) {
 	} else if (lua_isstring(L, 1)) {
 		int format = optencoding(L, 2, "*", X509_ANY|X509_PEM|X509_DER);
 		int pubonly = 0, prvtonly = 0;
-		const char *opt, *data;
+		const char *type, *data;
 		size_t len;
 		BIO *bio;
 		EVP_PKEY *pub = NULL, *prvt = NULL;
 		int goterr = 0;
 
 		/* check if specified publickey or privatekey */
-		if ((opt = luaL_optstring(L, 3, NULL))) {
-			if (xtolower(opt[0]) == 'p' && xtolower(opt[1]) == 'u') {
+		if ((type = luaL_optstring(L, 3, NULL))) {
+			if (xtolower(type[0]) == 'p' && xtolower(type[1]) == 'u') {
 				pubonly = 1;
-			} else if (xtolower(opt[0]) == 'p' && xtolower(opt[1]) == 'r') {
+			} else if (xtolower(type[0]) == 'p' && xtolower(type[1]) == 'r') {
 				prvtonly = 1;
 			} else {
-				return luaL_argerror(L, 3, lua_pushfstring(L, "invalid option %s", opt));
+				return luaL_argerror(L, 3, lua_pushfstring(L, "invalid type: %s", type));
 			}
 		}
 
-- 
2.24.1