mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 04:13:35 +00:00
sprintf_s1
svn path=/trunk/; revision=19776
This commit is contained in:
@@ -166,6 +166,7 @@ BOOL exists_path(LPCTSTR path);
|
||||
#endif
|
||||
|
||||
|
||||
// secure CRT functions
|
||||
#ifdef __STDC_WANT_SECURE_LIB__ // for VS 2005: _MSC_VER>=1400
|
||||
|
||||
#undef _vsntprintf
|
||||
|
||||
@@ -464,7 +464,7 @@ std::string XMLReaderBase::get_error_string() const
|
||||
std::string EncodeXMLString(const XS_String& str)
|
||||
{
|
||||
LPCXSSTR s = str.c_str();
|
||||
LPXSSTR buffer = (LPXSSTR)alloca(5*sizeof(XS_CHAR)*XS_len(s)); // worst case. "&"
|
||||
LPXSSTR buffer = (LPXSSTR)alloca(6*sizeof(XS_CHAR)*XS_len(s)); // worst case """ / "'"
|
||||
LPXSSTR o = buffer;
|
||||
|
||||
for(LPCXSSTR p=s; *p; ++p)
|
||||
@@ -492,7 +492,7 @@ std::string EncodeXMLString(const XS_String& str)
|
||||
default:
|
||||
if ((unsigned)*p<20 && *p!='\t' && *p!='\r' && *p!='\n') {
|
||||
char b[16];
|
||||
sprintf(b, "&%d;", (unsigned)*p);
|
||||
sprintf_s1(b, COUNTOF(b), "&%d;", (unsigned)*p);
|
||||
for(const char*q=b; *q; )
|
||||
*o++ = *q++;
|
||||
} else
|
||||
|
||||
@@ -71,6 +71,14 @@
|
||||
namespace XMLStorage {
|
||||
|
||||
|
||||
// secure CRT functions
|
||||
#ifdef __STDC_WANT_SECURE_LIB__ // VS 2005
|
||||
#define sprintf_s1 sprintf_s
|
||||
#else
|
||||
#define sprintf_s1(b, l, f, p1) sprintf(b, f, p1)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef XS_String
|
||||
|
||||
#ifdef XS_STRING_UTF8
|
||||
|
||||
Reference in New Issue
Block a user