use `estrndup` instead?