diff options
author | Chris Robinson <[email protected]> | 2019-06-06 04:39:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-06 04:39:30 -0700 |
commit | 87ccdf02a7f2c9611badaa434a91eb1cf31a4b97 (patch) | |
tree | 5fc4f2ab014b1036145f08f4620baff56056bfaa | |
parent | 56faf66887acb1b8481efec21eb223670524a50a (diff) |
Avoid strcpy
-rw-r--r-- | Alc/hrtf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<EnumeratedHrtf> &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 |