diff options
Diffstat (limited to 'mysql')
-rw-r--r-- | mysql/types/test.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 5e6c7b4..aaf6df7 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -9,7 +9,7 @@ #include <string> #include <vector> #include <memory> // std::auto_ptr -#include <cstring> // std::strncpy, std::str[n]cmp +#include <cstring> // std::memcpy, std::str[n]cmp, std::strlen #include <odb/core.hxx> @@ -282,8 +282,8 @@ struct char_array char_array (unsigned long id, const char* s) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); - std::strncpy (s2, s, sizeof (s2)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. + std::memcpy (s2, s, std::strlen (s) + 1); s3[0] = c1 = *s; } |