fix uninitialized variables in logger

This commit is contained in:
Andre Puschmann 2018-02-07 14:45:44 +01:00
parent fa7d5bd40e
commit 705acec6b9
2 changed files with 6 additions and 2 deletions

View File

@ -70,6 +70,7 @@ public:
level = LOG_LEVEL_NONE;
hex_limit = 0;
show_layer_en = true;
add_string_en = false;
level_text_short = true;
}
@ -79,6 +80,7 @@ public:
level = LOG_LEVEL_NONE;
hex_limit = 0;
show_layer_en = true;
add_string_en = false;
level_text_short = true;
}

View File

@ -36,6 +36,8 @@ namespace srslte{
logger_file::logger_file()
:inited(false)
,not_done(true)
,cur_length(0)
,max_length(0)
{}
logger_file::~logger_file() {
@ -48,11 +50,11 @@ logger_file::~logger_file() {
}
}
void logger_file::init(std::string file, int max_length) {
void logger_file::init(std::string file, int max_length_) {
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&not_empty, NULL);
pthread_cond_init(&not_full, NULL);
this->max_length = max_length*1024;
max_length = max_length_*1024;
name_idx = 0;
filename = file;
logfile = fopen(filename.c_str(), "w");