aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/query/array/driver.cxx3
-rw-r--r--mssql/types/test.hxx8
2 files changed, 6 insertions, 5 deletions
diff --git a/common/query/array/driver.cxx b/common/query/array/driver.cxx
index b47fc93..dcbe095 100644
--- a/common/query/array/driver.cxx
+++ b/common/query/array/driver.cxx
@@ -7,6 +7,7 @@
#include <string>
#include <memory> // std::auto_ptr
+#include <cstring> // std::memcpy
#include <cassert>
#include <iostream>
@@ -146,7 +147,7 @@ main (int argc, char* argv[])
//
#ifdef ODB_CXX11
array<char, 17> a;
- strcpy (a.data (), "abc");
+ memcpy (a.data (), "abc", 4); // VC++ strcpy deprecation.
#ifndef DATABASE_COMMON
assert (size (db->query<object> (query::a == a)) == 1);
diff --git a/mssql/types/test.hxx b/mssql/types/test.hxx
index 15070e3..aea64cb 100644
--- a/mssql/types/test.hxx
+++ b/mssql/types/test.hxx
@@ -402,11 +402,11 @@ struct char_array
}
else
{
- std::strcpy (ls1, s);
- std::strcpy (ls2, s);
+ std::memcpy (ls1, s, std::strlen (s) + 1); // VC++ strcpy deprecation.
+ std::memcpy (ls2, s, std::strlen (s) + 1);
- std::wcscpy (lws1, ws);
- std::wcscpy (lws2, ws);
+ std::memcpy (lws1, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t));
+ std::memcpy (lws2, ws, (std::wcslen (ws) + 1) * sizeof (wchar_t));
}
}