mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
case to unsigned; reorder expression
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2007, 2009, 2011-2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
|
||||
* Copyright (C) 1999-2007, 2009, 2011-2014, 2016-2018 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -1281,8 +1281,8 @@ remove_old_tsversions(isc_logfile_t *file, int versions) {
|
||||
&digit_end, 10);
|
||||
if (*digit_end == '\0') {
|
||||
int i = 0;
|
||||
while (version < to_keep[i] &&
|
||||
i < versions)
|
||||
while (i < versions &&
|
||||
version < to_keep[i])
|
||||
{
|
||||
i++;
|
||||
}
|
||||
@@ -1353,7 +1353,7 @@ roll_increment(isc_logfile_t *file) {
|
||||
*/
|
||||
for (greatest = 0; greatest < INT_MAX; greatest++) {
|
||||
n = snprintf(current, sizeof(current),
|
||||
"%s.%u", path, greatest) ;
|
||||
"%s.%u", path, (unsigned)greatest) ;
|
||||
if (n >= (int)sizeof(current) || n < 0 ||
|
||||
!isc_file_exists(current))
|
||||
{
|
||||
@@ -1380,13 +1380,14 @@ roll_increment(isc_logfile_t *file) {
|
||||
|
||||
for (i = greatest; i > 0; i--) {
|
||||
result = ISC_R_SUCCESS;
|
||||
n = snprintf(current, sizeof(current), "%s.%u", path, i - 1);
|
||||
n = snprintf(current, sizeof(current), "%s.%u", path,
|
||||
(unsigned)(i - 1));
|
||||
if (n >= (int)sizeof(current) || n < 0) {
|
||||
result = ISC_R_NOSPACE;
|
||||
}
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
n = snprintf(newpath, sizeof(newpath), "%s.%u",
|
||||
path, i);
|
||||
path, (unsigned)i);
|
||||
if (n >= (int)sizeof(newpath) || n < 0) {
|
||||
result = ISC_R_NOSPACE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user