tests: Use snprintf instead of sprintf
sprintf now results in a deprecation warning in Xcode 14 beta.
This commit is contained in:
parent
2639dfd053
commit
ab8453c572
@ -736,7 +736,7 @@ struct temp_file
|
|||||||
temp_file()
|
temp_file()
|
||||||
{
|
{
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
sprintf(path, "%stempfile%d", test_runner::_temp_path, index++);
|
snprintf(path, sizeof(path), "%stempfile%d", test_runner::_temp_path, index++);
|
||||||
}
|
}
|
||||||
|
|
||||||
~temp_file()
|
~temp_file()
|
||||||
|
|||||||
@ -795,7 +795,7 @@ struct test_walker: xml_tree_walker
|
|||||||
std::basic_string<char_t> depthstr() const
|
std::basic_string<char_t> depthstr() const
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
sprintf(buf, "%d", depth());
|
snprintf(buf, sizeof(buf), "%d", depth());
|
||||||
|
|
||||||
#ifdef PUGIXML_WCHAR_MODE
|
#ifdef PUGIXML_WCHAR_MODE
|
||||||
wchar_t wbuf[32];
|
wchar_t wbuf[32];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user