Skip to content

Commit

Permalink
fix underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
willamowius committed Jul 8, 2024
1 parent f8b542f commit ef686d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Toolkit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Toolkit base class for the GnuGk
//
// Copyright (c) 2000-2023, Jan Willamowius
// Copyright (c) 2000-2024, Jan Willamowius
//
// This work is published under the GNU Public License version 2 (GPLv2)
// see file COPYING for details.
Expand Down Expand Up @@ -3811,7 +3811,7 @@ void Toolkit::SetGKHome(const PStringArray & home)
}
}
// remove INADDR_ANY
for (size_t n = 0; n < m_GKHome.size(); ++n) {
for (int n = 0; n < (int)m_GKHome.size(); ++n) {
if ((m_GKHome[n] == INADDR_ANY)
#ifdef hasIPV6
|| m_GKHome[n].IsLinkLocal()
Expand All @@ -3824,7 +3824,7 @@ void Toolkit::SetGKHome(const PStringArray & home)
}
// if IPv6 is not enabled, remove _all_ IPv6 addresses
if (!IsIPv6Enabled()) {
for (size_t n = 0; n < m_GKHome.size(); ++n) {
for (int n = 0; n < (int)m_GKHome.size(); ++n) {
if (m_GKHome[n].GetVersion() == 6) {
m_GKHome.erase(m_GKHome.begin() + n);
--n; // re-test the new element on position n
Expand Down

0 comments on commit ef686d3

Please sign in to comment.