diff options
author | Luca Deri <deri@ntop.org> | 2024-10-19 16:39:49 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2024-10-20 18:40:49 +0200 |
commit | 17cda52fc7d99cffd9a748efea87b9df10562f4b (patch) | |
tree | 98a8835a8a43b45ef927181b799a3c82551c5d5f /wireshark/ndpi.lua | |
parent | 12a217d067c8bc012ea9e5ec32dd77f495f6011e (diff) |
Minor inf fix
Diffstat (limited to 'wireshark/ndpi.lua')
-rw-r--r-- | wireshark/ndpi.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/wireshark/ndpi.lua b/wireshark/ndpi.lua index c1758c03d..5372d9fa2 100644 --- a/wireshark/ndpi.lua +++ b/wireshark/ndpi.lua @@ -613,6 +613,8 @@ function round(num, idp) end function formatPctg(p) + if(p == nil) then p = 0 end + local p = round(p, 1) if(p < 1) then return("< 1 %") end @@ -2063,6 +2065,8 @@ local function ndpi_dialog_menu() end i = 0 + if(tot == 0) then return end + for k,v in pairsByValues(ndpi_protos, rev) do local pctg = formatPctg((v * 100) / tot) label = label .. string.format("%-32s\t\t%s\t", k, bytesToSize(v)).. "\t["..pctg.."]\n" |