]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/prefill nit: explicit conversion isn't needed here
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 2 Dec 2021 18:29:30 +0000 (19:29 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 22 Dec 2021 12:49:51 +0000 (13:49 +0100)
modules/prefill/prefill.lua

index 6bcbc09a1aa9950b5c6e38e11715aa399b052637..f4a42886e1e5386cdd3ef68a6630d910c9908d71 100644 (file)
@@ -56,9 +56,7 @@ end
 -- returns: number of seconds the file is valid for
 -- 0 indicates immediate download
 local function get_file_ttl(fname)
-       local c_str = ffi.new("char[?]", #fname)
-       ffi.copy(c_str, fname)
-       local mtime = tonumber(ffi.C.kr_file_mtime(c_str))
+       local mtime = tonumber(ffi.C.kr_file_mtime(fname))
 
        if mtime > 0 then
                local age = os.time() - mtime