self provided strndup & strdup