diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-04-02 13:27:08 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-04-02 13:27:08 +0000 |
commit | 74bf17b8ff5b7cd6908f5d7a59739479297f668e (patch) | |
tree | cda032662a2866644a9c615e05e0c9d1572e1ef1 /openmp/runtime/src/extractExternal.cpp | |
parent | 1362ae750fbd9cbf32e23a56852a5d116720182d (diff) | |
download | bcm5719-llvm-74bf17b8ff5b7cd6908f5d7a59739479297f668e.tar.gz bcm5719-llvm-74bf17b8ff5b7cd6908f5d7a59739479297f668e.zip |
Replace some unsafe API calls with safe alternatives on Windows, prepare code for similar actions on other platforms - wrap unsafe API calls into macros.
llvm-svn: 233915
Diffstat (limited to 'openmp/runtime/src/extractExternal.cpp')
-rw-r--r-- | openmp/runtime/src/extractExternal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openmp/runtime/src/extractExternal.cpp b/openmp/runtime/src/extractExternal.cpp index bb03b50a3bb..7a6fdb7e297 100644 --- a/openmp/runtime/src/extractExternal.cpp +++ b/openmp/runtime/src/extractExternal.cpp @@ -139,8 +139,8 @@ private: data = new char[length = _length]; } *(unsigned*)data = length; - memcpy(data + sizeof(unsigned), _data + sizeof(unsigned), - length - sizeof(unsigned)); + KMP_MEMCPY(data + sizeof(unsigned), _data + sizeof(unsigned), + length - sizeof(unsigned)); makeDirectory(); } public: @@ -192,7 +192,7 @@ public: size_t l = str.size(); if(l > 8) { directory.insert(make_pair(str, p - data)); - memcpy(p, str.c_str(), l); + KMP_MEMCPY(p, str.c_str(), l); p[l] = 0; p += l + 1; } @@ -211,7 +211,7 @@ public: if(str.size() <= 8) { // encoded directly ((char*)&r)[7] = 0; - strncpy((char*)&r, str.c_str(), 8); + KMP_STRNCPY_S((char*)&r, sizeof(r), str.c_str(), 8); return r; } else { // represented as index into table |