OS X doesn't have a strndup(), so roll our own.

a better solution would be to just whack it, as you can get some memory
leaks if you're not careful. i haven't seen any tho.



<!---
@huboard:{"order":13.0}
-->