diff --git a/tester/common/bc_tester_utils.c b/tester/common/bc_tester_utils.c index bc1980d17..62ccc5f19 100644 --- a/tester/common/bc_tester_utils.c +++ b/tester/common/bc_tester_utils.c @@ -445,11 +445,8 @@ void bc_tester_uninit(void) { } static void bc_tester_set_dir_prefix(char **prefix, const char *name) { - size_t len = strlen(name); if (*prefix != NULL) free(*prefix); - *prefix = malloc(len + 1); - strncpy(*prefix, name, len); - (*prefix)[len] = '\0'; + *prefix = strdup(name); } const char * bc_tester_get_resource_dir_prefix(void) { @@ -474,7 +471,6 @@ static char * bc_tester_path(const char *prefix, const char *name) { size_t len = strlen(prefix) + 1 + strlen(name) + 1; file = malloc(len); snprintf(file, len, "%s/%s", prefix, name); - file[strlen(file)] = '\0'; } return file; } diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index d49c890de..1c542d736 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -196,7 +196,7 @@ int main (int argc, char *argv[]) liblinphone_tester_init(NULL); - if (strstr(argv[0], ".libs")) { + if (strstr(argv[0], ".libs") && argv[0][0] == '/') { char res_dir[128] = {0}; // this allows to launch liblinphone_tester from outside of tester directory strncpy(res_dir, argv[0], strstr(argv[0], ".libs")-argv[0]); diff --git a/tester/message_tester.c b/tester/message_tester.c index 36326f1e7..f2e663483 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1431,7 +1431,7 @@ static void is_composing_notification(void) { LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); chat_room = linphone_core_get_chat_room(pauline->lc, marie->identity); - + linphone_core_get_chat_room(marie->lc, pauline->identity); /*make marie create the chatroom with pauline, which is necessary for receiving the is-composing*/ { int dummy=0; wait_for_until(marie->lc,pauline->lc,&dummy,1,100); /*just to have time to purge message stored in the server*/