Fixed MemberProxy::set(char[]) not duplicating the string (fixes #1191)

This commit is contained in:
Benoit Blanchon
2020-02-22 12:06:39 +01:00
parent 300323cfd7
commit af0edecddb
5 changed files with 27 additions and 3 deletions

View File

@ -22,4 +22,12 @@ TEST_CASE("ElementProxy::set()") {
REQUIRE(doc.as<std::string>() == "[\"world\"]");
}
SECTION("set(char[])") {
char s[] = "world";
ep.set(s);
strcpy(s, "!!!!!");
REQUIRE(doc.as<std::string>() == "[\"world\"]");
}
}