strndup isn't portable, instead we're allocating a buffer on the stack
whooohooo