add strdup func to fix segfault on windows