Use secure string function when compiling with a recent MSVC.

This commit is contained in:
Christopher Kohlhoff 2011-03-22 10:04:06 +11:00
parent ba4c189efb
commit b749ace67f

View File

@ -493,8 +493,13 @@ int context::password_callback_function(
std::string passwd = callback->call(static_cast<std::size_t>(size),
purpose ? context_base::for_writing : context_base::for_reading);
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(UNDER_CE)
strcpy_s(buf, size, passwd.c_str());
#else
*buf = '\0';
strncat(buf, passwd.c_str(), size);
#endif
return strlen(buf);
}