From 3952e2fd62baa7a58b909a22538388f1c1a99fa9 Mon Sep 17 00:00:00 2001 From: nnposter Date: Sun, 9 Apr 2017 13:33:31 +0000 Subject: [PATCH] Fixes an issue that caused long integers to be expressed in scientific notation. Fixes #807 --- CHANGELOG | 3 +++ nselib/json.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c9e699258..b0b2261f2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE][GH#807] Fixed a JSON library issue that was causing long integers + to be expressed in the scientific/exponent notation. [nnposter] + o [Ncat] Made -i/--idle-timeout not cause Ncat in server mode to close while waiting for an initial connection. This was also causing -i to interfere with the HTTP proxy server mode. [Carlos Manso, Daniel Miller] diff --git a/nselib/json.lua b/nselib/json.lua index 34a017fbd..ec0ea8dfb 100644 --- a/nselib/json.lua +++ b/nselib/json.lua @@ -233,7 +233,7 @@ function generate(obj) elseif obj == true then return "true" elseif type(obj) == "number" then - return string.format("%g", obj) + return tostring(obj) elseif type(obj) == "string" then return escape(obj) elseif type(obj) == "table" then