2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

[master] change strtoll() to isc_string_touint64() for portability

This commit is contained in:
Evan Hunt
2017-03-09 15:17:10 -08:00
parent 612b2e2c0d
commit ff711c866c

View File

@@ -1276,8 +1276,9 @@ remove_old_tsversions(isc_logfile_t *file, int versions) {
strncmp(dir.entry.name, bname, bnamelen) == 0 &&
dir.entry.name[bnamelen] == '.')
{
version = strtoll(&dir.entry.name[bnamelen + 1],
&digit_end, 10);
char *ename = &dir.entry.name[bnamelen + 1];
version = isc_string_touint64(ename,
&digit_end, 10);
if (*digit_end == '\0') {
int i = 0;
while (version < to_keep[i] &&
@@ -1311,8 +1312,8 @@ remove_old_tsversions(isc_logfile_t *file, int versions) {
strncmp(dir.entry.name, bname, bnamelen) == 0 &&
dir.entry.name[bnamelen] == '.')
{
version = strtoll(&dir.entry.name[bnamelen + 1],
&digit_end, 10);
char *ename = &dir.entry.name[bnamelen + 1];
version = isc_string_touint64(ename, &digit_end, 10);
/*
* Remove any backup files that exceed versions.
*/