fix "‘strdup’ was not declared in this scope"