Skip to content

Commit

Permalink
Use memcpy instead of strcpy to resolve MSVC errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Jul 14, 2024
1 parent c65d5df commit 89da1e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_class_sh_property_bakein.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#include "pybind11_tests.h"

#include <cstring>

namespace test_class_sh_property_bakein {

struct WithCharArrayMember {
WithCharArrayMember() { std::strcpy(char6_member, "Char6"); }
WithCharArrayMember() { std::memcpy(char6_member, "Char6", 6); }
char char6_member[6];
};

Expand Down

0 comments on commit 89da1e2

Please sign in to comment.