use own strdup to be c99 compliant