output: avoid mixing ntop_ipaddr() output buffers

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-11-11 08:12:51 +00:00
parent 66183bc7c7
commit 50fc4ebe9d
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
2 changed files with 8 additions and 8 deletions

View file

@ -80,8 +80,8 @@ static int must_put_range(void *closure, const char *name, int escape
return 0; return 0;
} }
if (!strcmp(name, "range")) { if (!strcmp(name, "range")) {
fprintf(file, "%s - %s", ntop_ipaddr(&e->range_p->first_ip), fprintf(file, "%s - ", ntop_ipaddr(&e->range_p->first_ip));
ntop_ipaddr(&e->range_p->last_ip)); fprintf(file, "%s", ntop_ipaddr(&e->range_p->last_ip));
return 0; return 0;
} }
if (!strcmp(name, "first_ip")) { if (!strcmp(name, "first_ip")) {

View file

@ -1,6 +1,6 @@
Subnets: Subnets:
location: example1 location: example1
range: 10.1.0.1 - 10.1.0.1 range: 10.1.0.1 - 10.1.0.20
first_ip: 10.1.0.1 first_ip: 10.1.0.1
last_ip: 10.1.0.20 last_ip: 10.1.0.20
used: 10 used: 10
@ -15,7 +15,7 @@ Subnets:
status: 0 status: 0
location: example2 location: example2
range: 10.2.0.1 - 10.2.0.1 range: 10.2.0.1 - 10.2.0.20
first_ip: 10.2.0.1 first_ip: 10.2.0.1
last_ip: 10.2.0.20 last_ip: 10.2.0.20
used: 8 used: 8
@ -30,7 +30,7 @@ Subnets:
status: 0 status: 0
location: example2 location: example2
range: 10.3.0.1 - 10.3.0.1 range: 10.3.0.1 - 10.3.0.20
first_ip: 10.3.0.1 first_ip: 10.3.0.1
last_ip: 10.3.0.20 last_ip: 10.3.0.20
used: 9 used: 9
@ -45,7 +45,7 @@ Subnets:
status: 0 status: 0
location: All networks location: All networks
range: 10.4.0.1 - 10.4.0.1 range: 10.4.0.1 - 10.4.0.20
first_ip: 10.4.0.1 first_ip: 10.4.0.1
last_ip: 10.4.0.20 last_ip: 10.4.0.20
used: 5 used: 5
@ -102,7 +102,7 @@ Summary:
--- skip ok --- --- skip ok ---
Subnets: Subnets:
location: example1 location: example1
range: 10.1.0.1 - 10.1.0.1 range: 10.1.0.1 - 10.1.0.20
first_ip: 10.1.0.1 first_ip: 10.1.0.1
last_ip: 10.1.0.20 last_ip: 10.1.0.20
used: 10 used: 10
@ -117,7 +117,7 @@ Subnets:
status: 1 status: 1
location: example2 location: example2
range: 10.3.0.1 - 10.3.0.1 range: 10.3.0.1 - 10.3.0.20
first_ip: 10.3.0.1 first_ip: 10.3.0.1
last_ip: 10.3.0.20 last_ip: 10.3.0.20
used: 9 used: 9