Skip to content

Commit a276f2c

Browse files
committed
Updated to improve based on static analyzer report.
1 parent 7acfc6f commit a276f2c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mobdebug.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,9 @@ local function handle(params, client, options)
14251425
local lines = file:read("*all"):gsub("^#!.-\n", "\n")
14261426
file:close()
14271427

1428-
local file = string.gsub(exp, "\\", "/") -- convert slash
1429-
file = removebasedir(file, basedir)
1430-
client:send("LOAD " .. tostring(#lines) .. " " .. file .. "\n")
1428+
local fname = string.gsub(exp, "\\", "/") -- convert slash
1429+
fname = removebasedir(fname, basedir)
1430+
client:send("LOAD " .. tostring(#lines) .. " " .. fname .. "\n")
14311431
if #lines > 0 then client:send(lines) end
14321432
end
14331433
while true do
@@ -1643,7 +1643,7 @@ local function listen(host, port)
16431643

16441644
while true do
16451645
io.write("> ")
1646-
local file, line, err = handle(io.read("*line"), client)
1646+
local file, _, err = handle(io.read("*line"), client)
16471647
if not file and err == false then break end -- completed debugging
16481648
end
16491649

0 commit comments

Comments
 (0)