From dde083e900216993d92642ae1ececf1120a201af Mon Sep 17 00:00:00 2001 From: david Date: Thu, 12 Feb 2009 04:23:41 +0000 Subject: [PATCH] Fix the formatting of the uptime in snmp-ssydescr.nse so it looks like "0:03:02.72 (18272 timeticks)", not "0:3:2.72 (18272 timeticks)" (note padding zeroes). --- scripts/snmp-sysdescr.nse | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/snmp-sysdescr.nse b/scripts/snmp-sysdescr.nse index 2dd527e31..653702cab 100644 --- a/scripts/snmp-sysdescr.nse +++ b/scripts/snmp-sysdescr.nse @@ -100,13 +100,12 @@ action = function(host, port) local dayLabel if days == 1 then - dayLabel = " day, " + dayLabel = "day" else - dayLabel = " days, " + dayLabel = "days" end - result = result .. "\n System uptime: " .. days .. dayLabel .. hours .. ":" .. minutes .. ":" .. seconds - result = result .. " (" .. tostring(uptime) .. " timeticks)" + result = result .. "\n" .. string.format(" System uptime: %d %s, %d:%02d:%05.2f (%s timeticks)", days, dayLabel, hours, minutes, seconds, tostring(uptime)) return result end