change implementation of strcpy_s and strncpy_s for Linux

use memcpy instead of strncpy.

Change-Id: Ic079f21a28ec7e258e134c6e1be4cde81df736ec
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2018-12-10 15:03:09 +01:00
committed by sys_ocldev
parent d2f1a15f03
commit be6d70c909

View File

@@ -21,7 +21,7 @@ inline int strcpy_s(char *dst, size_t dstSize, const char *src) {
return -ERANGE;
}
strncpy(dst, src, length);
memcpy(dst, src, length);
dst[length] = '\0';
return 0;
@@ -39,7 +39,7 @@ inline int strncpy_s(char *dst, size_t numberOfElements, const char *src, size_t
if (length > count) {
length = count;
}
strncpy(dst, src, length);
memcpy(dst, src, length);
if (length < numberOfElements) {
numberOfElements = length;