From bc654bcc683d23907e94cd2af31a73eb3ec73b81 Mon Sep 17 00:00:00 2001 From: Gilles Bouthenot Date: Wed, 5 Dec 2012 12:54:49 +0100 Subject: [PATCH] json output: bugfix: correct range specify only first ip Reviewed-by: Sami Kerola Signed-off-by: Gilles Bouthenot --- src/output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/output.c b/src/output.c index eb99454..3a2a921 100644 --- a/src/output.c +++ b/src/output.c @@ -384,8 +384,10 @@ int output_json(void) fprintf(outfile, "\"location\":\"\", "); } - fprintf(outfile, "\"range\":\"%s\", ", + fprintf(outfile, "\"range\":\"%s", ntop_ipaddr(&range_p->first_ip)); + fprintf(outfile, " - %s\", ", + ntop_ipaddr(&range_p->last_ip)); fprintf(outfile, "\"defined\":%lu, ", range_size); fprintf(outfile, "\"used\":%lu, ", range_p->count); fprintf(outfile, "\"free\":%lu ",