diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 11:48:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-02-08 11:48:37 +0200 |
commit | edb7ba7437aa577d65da942aaf778c16c9a501ed (patch) | |
tree | 8002ee45759c89c77f01e7748f917a64b4705989 /pgsql | |
parent | 039beb368bf43572b0400521a7859dd635a8f22f (diff) |
Recode strncpy as memcpy
VC12 deprecated those hard, as in, it is now an error.
Diffstat (limited to 'pgsql')
-rw-r--r-- | pgsql/types/test.hxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pgsql/types/test.hxx b/pgsql/types/test.hxx index f3a7d26..773742e 100644 --- a/pgsql/types/test.hxx +++ b/pgsql/types/test.hxx @@ -9,7 +9,7 @@ #include <string> #include <vector> #include <memory> // std::auto_ptr -#include <cstring> // std::memcmp, std::strncpy, std::str[n]cmp +#include <cstring> // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen #include <cstddef> // std::size_t #include <odb/core.hxx> @@ -191,8 +191,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; } |