mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
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:
parent
b524296016
commit
98bcdf9378
4 changed files with 28 additions and 12 deletions
|
|
@ -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\": [");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue