diff --git a/src/getdata.c b/src/getdata.c index a5b7990..0c69fae 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -72,7 +72,7 @@ int parse_leases(void) struct stat lease_file_stats; struct macaddr_t *macaddr_p = NULL; int sw_active_lease = 0; - struct leases_t * lease; + struct leases_t *lease; num_touches = num_leases = num_backups = 0; @@ -130,20 +130,20 @@ int parse_leases(void) if ((lease = find_lease(htonl(inp.s_addr))) != NULL) { delete_lease(lease); } - add_lease(htonl(inp.s_addr),ACTIVE); + add_lease(htonl(inp.s_addr), ACTIVE); sw_active_lease = 1; } else if (xstrstr(line, " binding state free", 20)) { /* remove old entry, if exists */ if ((lease = find_lease(htonl(inp.s_addr))) != NULL) { delete_lease(lease); } - add_lease(htonl(inp.s_addr),FREE); + add_lease(htonl(inp.s_addr), FREE); } else if (xstrstr(line, " binding state backup", 22)) { /* remove old entry, if exists */ if ((lease = find_lease(htonl(inp.s_addr))) != NULL) { delete_lease(lease); } - add_lease(htonl(inp.s_addr),BACKUP); + add_lease(htonl(inp.s_addr), BACKUP); } if ((macaddr != NULL) @@ -151,12 +151,13 @@ int parse_leases(void) && (xstrstr(line, " hardware ethernet", 19))) { nth_field(3, macstring, line); if (macstring) { - macstring[17] = '\0'; - macaddr_p->ethernet = safe_strdup(macstring); - macaddr_p->ip = safe_strdup(ipstring); - macaddr_p->next = safe_malloc(sizeof(struct macaddr_t)); - macaddr_p = macaddr_p->next; - macaddr_p->next = NULL; + macstring[17] = '\0'; + macaddr_p->ethernet = safe_strdup(macstring); + macaddr_p->ip = safe_strdup(ipstring); + macaddr_p->next = + safe_malloc(sizeof(struct macaddr_t)); + macaddr_p = macaddr_p->next; + macaddr_p->next = NULL; } } } diff --git a/src/other.c b/src/other.c index 05e1cd7..a7346a2 100644 --- a/src/other.c +++ b/src/other.c @@ -71,7 +71,7 @@ extern void _exit(); #endif #ifndef HAVE___FPENDING -static size_t __fpending(FILE * fp) +static size_t __fpending(FILE *fp) { return (fp->_p - fp->_bf._base); } @@ -110,12 +110,12 @@ int /* two spaces are very common in lease file, after them * nearly everything differs */ if (a[2] != b[2]) { - return false; + return false; } /* " binding state " == 16 chars, this will skip right - * to first difering line. */ + * to first difering line. */ if (17 < len && a[17] != b[17]) { - return false; + return false; } /* looking good, double check the whole thing... */ for (i = 0; a[i] != '\0' && b[i] != '\0'; i++) { @@ -192,7 +192,7 @@ void clean_up(void) free(shared_networks); } -int close_stream(FILE * stream) +int close_stream(FILE *stream) { const int some_pending = (__fpending(stream) != 0); const int prev_fail = (ferror(stream) != 0); diff --git a/src/output.c b/src/output.c index c4c3db2..79189cf 100644 --- a/src/output.c +++ b/src/output.c @@ -426,7 +426,7 @@ static void output_long(FILE *restrict f, char const *restrict type, fprintf(f, " <%s class=ralign>%lu\n", type, unlong, type); } -static void output_float(FILE * f, char const *restrict type, float fl) +static void output_float(FILE *f, char const *restrict type, float fl) { fprintf(f, " <%s class=ralign>%.3f\n", type, fl, type); }