simplify output format selection, and passing

Use of enum is a lot more readable than passing strings, and comparing
characters, around.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2015-12-01 23:02:02 +00:00
parent b524296016
commit 98bcdf9378
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
4 changed files with 28 additions and 12 deletions

View file

@ -237,7 +237,7 @@ int output_xml(void)
fprintf(outfile, "<dhcpstatus>\n");
if (config.output_format[0] == 'X' || config.output_format[0] == 'J') {
if (config.output_format == OUTPUT_ETHERNETS) {
struct leases_t *l;
for (l = leases; l != NULL; l = l->hh.next) {
@ -342,7 +342,7 @@ int output_json(void)
fprintf(outfile, "{\n");
if (config.output_format[0] == 'X' || config.output_format[0] == 'J') {
if (config.output_format == OUTPUT_ETHERNETS) {
struct leases_t *l;
fprintf(outfile, " \"active_leases\": [");