Merge pull request #27 from haoyun/master

fix lakinduakash/linux-wifi-hotspot#25 lakinduakash/linux-wifi-hotspot#24
This commit is contained in:
Lakindu Akash 2019-06-02 14:09:13 +05:30 committed by GitHub
commit 15e9217534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -233,7 +233,7 @@ int get_running_info(char* a[3]){
static int init_get_interface_list(){
const char* cmd="ls -x /sys/class/net ";
const char* cmd="echo $( ls /sys/class/net ) ";
FILE *fp;
@ -366,4 +366,4 @@ char** get_wifi_interface_list(int *length){
return NULL;
}
}

View File

@ -48,7 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define ERROR_PASS_MSG "Password must contain 8 characters"
#define ERROR_CHANNEL_MSG "Invalid channel number"
#define ERROR_CHANNEL_MSG_2 "Channel must be 1-11"
#define ERROR_CHANNEL_MSG_5 "Channel must be 1-36"
#define ERROR_CHANNEL_MSG_5 "Channel must be 1-196"
#define ERROR_MAC_MSG "Invalid Mac address"
GtkBuilder *builder;
@ -284,7 +284,7 @@ static void* entry_channel_warn(GtkWidget *widget, gpointer data){
if (cv.freq == NULL) {
if (!(li <= 36 && li > 0)) {
if (!(li <= 196 && li > 0)) {
gtk_style_context_add_class(context_entry_channel, "entry-error");
set_error_text(ERROR_CHANNEL_MSG);
return FALSE;
@ -296,7 +296,7 @@ static void* entry_channel_warn(GtkWidget *widget, gpointer data){
return FALSE;
}
} else if (strcmp(cv.freq, "5") == 0) {
if (!(li <= 36 && li > 0)) {
if (!(li <= 196 && li > 0)) {
gtk_style_context_add_class(context_entry_channel, "entry-error");
set_error_text(ERROR_CHANNEL_MSG_5);
return FALSE;
@ -592,11 +592,11 @@ static void *run_create_hp_shell(void *cmd) {
char buf[BUFSIZE];
char buf2[BUFSIZE];
FILE *fp;
if(cv.freq){
cmd = strcat( cmd, " --freq-band ");
cmd = strcat( cmd, cv.freq);
if ((fp = popen(cmd, "r")) == NULL) {
printf("Error opening pipe!\n");
return NULL;
@ -609,7 +609,7 @@ static void *run_create_hp_shell(void *cmd) {
}
}
start_pb_pulse();
@ -691,14 +691,14 @@ static gboolean validator(ConfigValues *cv){
if(cv->freq==NULL){
if(!(li<=36 && li>0))
if(!(li<=196 && li>0))
return FALSE;
}
else if(strcmp(cv->freq,"2.4")==0){
if(!(li<=11 && li>0))
return FALSE;
} else if(strcmp(cv->freq,"5")==0){
if(!(li<=36 && li>0))
if(!(li<=196 && li>0))
return FALSE;
}