mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Avoid a couple potential format string problems
This commit is contained in:
parent
2e5964f745
commit
265e32dbd6
2 changed files with 4 additions and 4 deletions
|
|
@ -299,10 +299,10 @@ Response = {
|
|||
|
||||
local function decode_bitcoin_version(n)
|
||||
if ( n < 31300 ) then
|
||||
local minor, micro = n / 100, n % 100
|
||||
local minor, micro = n // 100, n % 100
|
||||
return ("0.%d.%d"):format(minor, micro)
|
||||
else
|
||||
local minor, micro = n / 10000, (n / 100) % 100
|
||||
local minor, micro = n // 10000, (n // 100) % 100
|
||||
return ("0.%d.%d"):format(minor, micro)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -114,10 +114,10 @@ end
|
|||
-- Version 0.3.13 release announcement: https://bitcointalk.org/?topic=1327.0
|
||||
local function decode_bitcoin_version(n)
|
||||
if n < 31300 then
|
||||
local minor, micro = n / 100, n % 100
|
||||
local minor, micro = n // 100, n % 100
|
||||
return string.format("0.%d.%d", minor, micro)
|
||||
else
|
||||
local minor, micro = n / 10000, (n / 100) % 100
|
||||
local minor, micro = n // 10000, (n // 100) % 100
|
||||
return string.format("0.%d.%d", minor, micro)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue