Fix Nullpointer in dawn init

This commit is contained in:
PolynomialDivision 2017-09-19 11:48:11 +02:00
parent 81ecf9d161
commit e4c5feb40e
3 changed files with 8 additions and 3 deletions

View file

@ -20,4 +20,4 @@ config settings metric
option chan_util '0'
option max_chan_util '100'
option min_rssi '-60'
option min_probe_count '5'
option min_probe_count '5'

View file

@ -13,4 +13,7 @@ int send_string_enc(char *msg);
void close_socket();
// save connections
// struct sockaddr_in addr[100];
#endif

View file

@ -94,7 +94,9 @@ struct probe_metric_s uci_get_dawn_metric()
if(ptr.o->type == UCI_TYPE_STRING)
ret.max_chan_util = atoi(ptr.o->v.string);
char tmp_min_probe_count[] = "dawn.min_probe_count";
printf("Try to load min_probe_count\n");
char tmp_min_probe_count[] = "dawn.metric.min_probe_count";
if (uci_lookup_ptr (c, &ptr, tmp_min_probe_count, 1) != UCI_OK) {
uci_perror(c, "uci_get_daw_metric Error");
return ret;
@ -104,7 +106,7 @@ struct probe_metric_s uci_get_dawn_metric()
printf("Loaded metric: %d\n", ret.min_probe_count);
uci_free_context (c);
uci_free_context(c);
return ret;
}