Fix the portability implementation of strndup
authorChristopher Dykes <cdykes@fb.com>
Thu, 31 Mar 2016 17:14:42 +0000 (10:14 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 31 Mar 2016 17:20:36 +0000 (10:20 -0700)
commite3774034e9e2e77d1f92a4b8ea00776b0daeb899
treebaa79c855e67cc0f85967f33ae291ebe8714486c
parent10001685609b018c9d3864f924616450c59942fe
Fix the portability implementation of strndup

Summary:It was mistakenly assuming the length passed in included the null terminator.
This also makes the portability implementation of `strndup` available to OSX and FreeBSD, where they weren't present, and where HHVM had a wrapper for them.
This also removes the extra pair of conditions around `memrchr`, as the main define should always be getting set.

Reviewed By: yfeldblum

Differential Revision: D3116467

fb-gh-sync-id: 243dd4dace219efab2c2bf2f383202e70fbec4de
fbshipit-source-id: 243dd4dace219efab2c2bf2f383202e70fbec4de
folly/portability/String.cpp
folly/portability/String.h