mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
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:
committed by
sys_ocldev
parent
d2f1a15f03
commit
be6d70c909
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user