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("MemberProxy::set()") {
REQUIRE(doc.as<std::string>() == "{\"hello\":\"world\"}");
}
SECTION("set(char[])") { // issue #1191
char s[] = "world";
mp.set(s);
strcpy(s, "!!!!!");
REQUIRE(doc.as<std::string>() == "{\"hello\":\"world\"}");
}
}