From 87ccdf02a7f2c9611badaa434a91eb1cf31a4b97 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 6 Jun 2019 04:39:30 -0700 Subject: Avoid strcpy --- Alc/hrtf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Alc/hrtf.cpp') diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index 668e5b24..2584ef13 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -1101,7 +1101,8 @@ void AddFileEntry(al::vector &list, const std::string &filename) LoadedHrtfs.emplace_back(HrtfHandle::Create(filename.length()+1)); loaded_entry = LoadedHrtfs.end()-1; - strcpy((*loaded_entry)->filename.data(), filename.c_str()); + std::copy(filename.begin(), filename.end(), (*loaded_entry)->filename.begin()); + (*loaded_entry)->filename.back() = '\0'; } /* TODO: Get a human-readable name from the HRTF data (possibly coming in a -- cgit v1.2.3