Commit ec077346 authored by Benjamin REIS's avatar Benjamin REIS

Fix compilation issue

parent 90827a79
......@@ -159,8 +159,8 @@ void belle_sip_tester_after_each(void) {
int belle_sip_tester_set_log_file(const char *filename) {
BctoolboxLogHandler* filehandler;
char dirbuffer[512];
char basebuffer[512];
char* dir;
char* base;
if (log_file) {
fclose(log_file);
}
......@@ -169,10 +169,14 @@ int belle_sip_tester_set_log_file(const char *filename) {
belle_sip_error("Cannot open file [%s] for writing logs because [%s]", filename, strerror(errno));
return -1;
}
dir = bctbx_strdup(filename);
base = bctbx_strdup(filename);
belle_sip_message("Redirecting traces to file [%s]", filename);
filehandler = bctbx_create_file_log_handler(0, dirname_r(filename, dirbuffer), basename_r(filename, basebuffer), log_file);
bctbx_add_log_handler(filehandler);
bctbx_add_log_handler(filehandler);
bctbx_free(dir);
bctbx_free(base);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment