mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 07:47:00 +00:00
getdata output: add start, end and hostname printing support for xml and json
Ensure strings are always null terminated.
This commit is contained in:
parent
7fc13c60e0
commit
dc649e27cd
1 changed files with 3 additions and 0 deletions
|
|
@ -148,7 +148,9 @@ int parse_leases(struct conf_t *state)
|
|||
if ((lease = find_lease(state, &addr)) != NULL) {
|
||||
lease->ethernet = xstrdup(macstring);
|
||||
lease->starts = xstrdup(startsstr);
|
||||
startsstr[0] = '\0';
|
||||
lease->ends = xstrdup(endsstr);
|
||||
endsstr[0] = '\0';
|
||||
}
|
||||
break;
|
||||
case PREFIX_ENDS:
|
||||
|
|
@ -171,6 +173,7 @@ int parse_leases(struct conf_t *state)
|
|||
if ((lease = find_lease(state, &addr)) != NULL) {
|
||||
lease->hostname = xstrdup(hostnamestr);
|
||||
}
|
||||
hostnamestr[0] = '\0';
|
||||
break;
|
||||
default:
|
||||
/* do nothing */ ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue