mirror of
https://github.com/lakinduakash/linux-wifi-hotspot.git
synced 2024-11-24 21:20:12 +00:00
Merge pull request #90 from lakinduakash/mac-filter
Fix crash on non existing nac filter file
This commit is contained in:
commit
cad1c0cf52
@ -157,8 +157,7 @@ const char* build_kill_create_ap_command(char* pid){
|
||||
|
||||
void write_accepted_macs(char* filename, char* accepted_macs){
|
||||
|
||||
printf("%s \n",filename);
|
||||
printf("%s \n",accepted_macs);
|
||||
printf("mac filter file %s \n",filename);
|
||||
|
||||
snprintf(cmd_write_mac,BUFSIZE,"%s '%s' %s %s","echo", accepted_macs, "| sudo tee", filename);
|
||||
int r=system(cmd_write_mac);
|
||||
@ -174,7 +173,6 @@ char * read_mac_filter_file(char * filename){
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
perror("Error while opening the file.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ void init_ui_from_config(){
|
||||
}
|
||||
|
||||
char *macs =read_mac_filter_file(values->accepted_mac_file);
|
||||
if (macs!=NULL || strlen(macs)<1){
|
||||
if (macs!=NULL && !strlen(macs)<1){
|
||||
gtk_text_buffer_set_text(buffer_mac_filter,macs,strlen(macs));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user