mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Changed use of strncpy to memcpy
This commit is contained in:
parent
699e571400
commit
a36395e2ff
@ -7,11 +7,9 @@
|
||||
|
||||
#include "catch_stringref.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <ostream>
|
||||
#include <cassert>
|
||||
|
||||
#define _CRT_SECURE_NO_WARNINGS // Suppress warnings from MSVC about strncpy not being secure
|
||||
#include <cstring>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
@ -95,7 +93,7 @@ namespace Catch {
|
||||
void StringRef::takeOwnership() {
|
||||
if( !isOwned() ) {
|
||||
m_data = new char[m_size+1];
|
||||
strncpy( m_data, m_start, m_size );
|
||||
memcpy( m_data, m_start, m_size );
|
||||
m_data[m_size] = '\0';
|
||||
m_start = m_data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user