From 049518d751b3e2bada5af0bd1af63273e782775f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 15 Jun 2014 11:42:41 +0300 Subject: [PATCH] Avoid unsigned int overflow if total number of hosts exceeds the maximum --- source/netvis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/netvis.cpp b/source/netvis.cpp index 83dbd1a..7bb49bb 100644 --- a/source/netvis.cpp +++ b/source/netvis.cpp @@ -126,7 +126,7 @@ void NetVis::tick() i->second->tick(dt); min_activity = min(min_activity, i->second->get_activity()); } - float del_limit = pow(10, 6-0.1*(max_hosts-hosts.size()-disabled_hosts.size())); + float del_limit = pow(10, 6-0.1*static_cast(max_hosts-hosts.size()-disabled_hosts.size())); for(map::iterator i=disabled_hosts.begin(); i!=disabled_hosts.end();) { i->second->tick(dt); -- 2.43.0