use strndup?