Commit 3589e6f5 authored by Grigorii Demidov's avatar Grigorii Demidov Committed by Petr Špaček

modules/dot, daemon/tls: fix lint warnings

parent 33601c4c
......@@ -820,7 +820,7 @@ struct tls_client_paramlist_entry *tls_client_try_upgrade(map_t *tls_client_para
}
/* Rewrite 053 -> 853 */
strcpy(key + keylen - 3, "853");
memcpy(key + keylen - 4, "853", 3);
return map_get(tls_client_paramlist, key);
}
......
......@@ -2,8 +2,7 @@
-- util functions
--------------------------------------------------------------------------------
local function divide_string( str, max, fillChar )
fillChar = fillChar or ""
local function divide_string( str, max )
local result = {}
local start = 1
......@@ -77,7 +76,7 @@ function basexx.to_bit( str )
return ( str:gsub( '.', function ( c )
local byte = string.byte( c )
local bits = {}
for i = 1,8 do
for _ = 1,8 do
table.insert( bits, byte % 2 )
byte = math.floor( byte / 2 )
end
......@@ -132,7 +131,7 @@ local function to_basexx( str, alphabet, bits, pad )
local chunks = divide_string( bitString, bits )
local result = {}
for key,value in ipairs( chunks ) do
for _,value in ipairs( chunks ) do
if ( #value < bits ) then
value = value .. string.rep( '0', bits - #value )
end
......
......@@ -8,7 +8,6 @@ local C = ffi.C
local M = {}
M.layer = {}
local base32 = {}
local base64 = {}
local str = {}
local AF_INET = 2
local AF_INET6 = 10
......@@ -93,14 +92,14 @@ function M.layer.consume(state, _, pkt)
if name == name_add then
local addrbuf
if rr_add.type == kres.type.A then
ns_addr = ffi.new("struct sockaddr_in")
local ns_addr = ffi.new("struct sockaddr_in")
ns_addr.sin_family = AF_INET
ns_addr.sin_addr.s_addr = rr_add.rdata
addrbuf = ffi.new("char[?]", INET_ADDRSTRLEN)
C.inet_ntop(AF_INET, ns_addr.sin_addr, addrbuf, INET_ADDRSTRLEN)
else
ns_addr = ffi.new("struct sockaddr_in6")
local ns_addr = ffi.new("struct sockaddr_in6")
ns_addr.sin6_family = AF_INET6
ns_addr.sin6_addr.s6_addr = rr_add.rdata
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment