mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
virlease: Use virTrimSpaces() instead of open coded alternative
In virLeaseNew() we are trying to remove trailing space (per comment it may happen that older versions of dnsmasq put it into an env variable). Well, instead of open coding it, we can use virTrimSpaces(). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
8e5659ed12
commit
003fff38e7
@ -226,8 +226,7 @@ virLeaseNew(virJSONValuePtr *lease_ret,
|
||||
|
||||
/* Removed extraneous trailing space in DNSMASQ_LEASE_EXPIRES
|
||||
* (dnsmasq < 2.52) */
|
||||
if (exptime[strlen(exptime) - 1] == ' ')
|
||||
exptime[strlen(exptime) - 1] = '\0';
|
||||
virTrimSpaces(exptime, NULL);
|
||||
}
|
||||
|
||||
if (!exptime ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user