From edb7ba7437aa577d65da942aaf778c16c9a501ed Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 8 Feb 2015 11:48:37 +0200 Subject: Recode strncpy as memcpy VC12 deprecated those hard, as in, it is now an error. --- pgsql/types/test.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pgsql') 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 #include #include // std::auto_ptr -#include // std::memcmp, std::strncpy, std::str[n]cmp +#include // std::memcmp, std::memcpy, std::str[n]cmp, std::strlen #include // std::size_t #include @@ -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; } -- cgit v1.1