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

@ -92,7 +92,7 @@ int parse_leases(void)
line[0] = '\0';
ipstring = xmalloc(sizeof(char) * MAXLEN);
ipstring[0] = '\0';
if (config.output_format[0] == 'X' || config.output_format[0] == 'J')
if (config.output_format == OUTPUT_ETHERNETS)
ethernets = true;
while (!feof(dhcpd_leases)) {
if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases))