Author: ks156
Date: 2009-02-13 11:22:35 +0100 (Fri, 13 Feb 2009)
New Revision: 3631
Modified:
software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_unix.c
Log:
* Applied the changes made by chmik
It was a problem with the mem when passing the cmd arguments.
Modified: software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_unix.c
===================================================================
--- software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_unix.c
2009-02-12 15:29:31 UTC (rev 3630)
+++ software_suite_v2/software/tux_wifi_channel/trunk/wifi_channel_unix.c
2009-02-13 10:22:35 UTC (rev 3631)
@@ -34,10 +34,12 @@
int chan = 0;
FILE *pcmd;
char buff[80];
- char iface[80];
+ char iface[10];
+ memset(&iface, NULL ,sizeof(iface));
+
/* Try to read the file containing the wireless card informations */
- pcmd = popen("cat /proc/net/wireless", "r");
+ pcmd = popen("cat /proc/net/wireless | grep : ", "r");
/* If the command is done without problem, read the output stream */
if (pcmd != NULL)
@@ -75,7 +77,8 @@
{
FILE *pcmd;
char buff[80];
- char cmd[80];
+ char cmd[sizeof(iface)+sizeof("iwconfig ")+1];
+ memset(&cmd, NULL ,sizeof(cmd));
float frequency;
/* Include the iface to the command */
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn