From ee753c0009da5bec4a71d3263e9623d04dddc5c4 Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 13 Mar 2004 21:59:48 +0000 Subject: Fix possible divide by null Patch for mickeyl... --- (limited to 'libopie2/opienet') diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index ab3e77f..26a6c81 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -57,10 +57,10 @@ #ifndef NODEBUG #include - - -using namespace Opie::Core; -using namespace Opie::Net::Private; + + +using namespace Opie::Core; +using namespace Opie::Net::Private; DebugMapper* debugmapper = new DebugMapper(); #endif @@ -68,8 +68,8 @@ DebugMapper* debugmapper = new DebugMapper(); * ONetwork *======================================================================================*/ -namespace Opie { -namespace Net { +namespace Opie { +namespace Net { ONetwork* ONetwork::_instance = 0; ONetwork::ONetwork() @@ -1006,7 +1006,8 @@ int OWirelessNetworkInterface::signalStrength() const int lev = stat.qual.level; //FIXME: Do something with them? int noi = stat.qual.noise; //FIXME: Do something with them? - return cur*100/max; + + return max != 0 ? cur*100/max: -1; } @@ -1243,6 +1244,6 @@ QString OOrinocoMonitoringInterface::name() const { return "orinoco"; } - -} -} + +} +} -- cgit v0.9.0.2