summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index f4bdbe0..05513f8 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -531,4 +531,3 @@ void OWirelessNetworkInterface::buildInformation()
int len = sizeof( struct iw_range )*2;
- char *buffer = (char*) malloc( len );
- //FIXME: Validate if we actually got the memory block
+ char buffer[len];
memset( buffer, 0, len );
@@ -536,3 +535,3 @@ void OWirelessNetworkInterface::buildInformation()
wrq.u.data.pointer = (caddr_t) buffer;
- wrq.u.data.length = sizeof( struct iw_range );
+ wrq.u.data.length = sizeof buffer;
wrq.u.data.flags = 0;
@@ -541,3 +540,3 @@ void OWirelessNetworkInterface::buildInformation()
{
- owarn << "OWirelessNetworkInterface::buildInformation(): Can't get channel information - using default values." << oendl;
+ owarn << "OWirelessNetworkInterface::buildInformation(): Can't get driver information (" << strerror( errno ) << ") - using default values." << oendl;
_channels.insert( 2412, 1 ); // 2.412 GHz
@@ -584,3 +583,2 @@ void OWirelessNetworkInterface::buildInformation()
odebug << "OWirelessNetworkInterface::buildInformation(): Information block constructed." << oendl;
- free(buffer);
}
@@ -606,3 +604,3 @@ void OWirelessNetworkInterface::buildPrivateList()
{
- owarn << "OWirelessNetworkInterface::buildPrivateList(): Can't get private ioctl information." << oendl;
+ owarn << "OWirelessNetworkInterface::buildPrivateList(): Can't get private ioctl information (" << strerror( errno ) << ")." << oendl;
return;
@@ -1160,3 +1158,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
{
- odebug << "IWEVQUAL" << oendl;
+ odebug << "IWEVQUAL" << oendl;
stations->last()->level = static_cast<int>(we->u.qual.level);
@@ -1166,3 +1164,3 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
{
- odebug << "SIOCGIWENCODE" << oendl;
+ odebug << "SIOCGIWENCODE" << oendl;
stations->last()->encrypted = !(we->u.data.flags & IW_ENCODE_DISABLED);