]> git.tdb.fi Git - netvis.git/commitdiff
Avoid unsigned int overflow if total number of hosts exceeds the maximum
authorMikko Rasa <tdb@tdb.fi>
Sun, 15 Jun 2014 08:42:41 +0000 (11:42 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 15 Jun 2014 08:42:41 +0000 (11:42 +0300)
source/netvis.cpp

index 83dbd1a78d53933bef55d1948fef43dc9024d3e0..7bb49bb458e507cb52d3f33cfcd17872f3537142 100644 (file)
@@ -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<int>(max_hosts-hosts.size()-disabled_hosts.size()));
        for(map<unsigned, Host *>::iterator i=disabled_hosts.begin(); i!=disabled_hosts.end();)
        {
                i->second->tick(dt);