fix a few bugs in FBString
authorPhilip Pronin <philipp@fb.com>
Tue, 15 Oct 2013 21:39:44 +0000 (14:39 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 24 Oct 2013 21:53:41 +0000 (14:53 -0700)
commit8c13c0b9ebf03cfd37d951efc88f43caaa18c051
tree318d30e9c223ed06cb53bed28473a12587cb93e6
parent796bfa8006d6a89889f07e663e763d7cb4a77578
fix a few bugs in FBString

Summary:
* `push_back()` fails for medium strings of zero capacity if not linked
with jemalloc (see added test),
* we incorrectly initiliaze capacity when acquire mallocated string
(forgot about null terminator).

Test Plan: fbconfig --allocator=malloc folly/test:fbstring_test_using_jemalloc && fbmake runtests_opt

@override-unit-failures

Reviewed By: tudorb@fb.com

FB internal diff: D1012196
folly/FBString.h
folly/test/FBStringTest.cpp