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. --- sqlite/types/test.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sqlite/types/test.hxx') diff --git a/sqlite/types/test.hxx b/sqlite/types/test.hxx index 5797089..5a0bb41 100644 --- a/sqlite/types/test.hxx +++ b/sqlite/types/test.hxx @@ -9,10 +9,10 @@ #include #include #include // std::auto_ptr -#include // std::strncpy, std::str[n]cmp +#include // std::memcpy, std::str[n]cmp, std::strlen #ifdef _WIN32 -# include // std::wcsncpy, std::wcs[n]cmp +# include // std::wcslen, std::wcs[n]cmp #endif #include @@ -85,11 +85,11 @@ struct char_array ) : id_ (id) { - std::strncpy (s1, s, sizeof (s1)); + std::memcpy (s1, s, std::strlen (s) + 1); // VC++ strncpy deprecation. s2[0] = c1 = *s; #ifdef _WIN32 - std::wcsncpy (ws1, ws, sizeof (ws1) / 2); + std::memcpy (ws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t)); ws2[0] = wc1 = *ws; #endif } -- cgit v1.1