[OpenMP] Fix incorrect KMP_STRLEN() macro
authorPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Thu, 25 Feb 2021 18:49:12 +0000 (12:49 -0600)
committerPeyton, Jonathan L <jonathan.l.peyton@intel.com>
Mon, 5 Apr 2021 14:03:09 +0000 (09:03 -0500)
commit2aebb7cb3c88b1446515563653c821e8165b3aaf
tree1cea176f080e07340c514b1709f294ba78622fb1
parent00a84f9a7f8916e024243e2685db4c11d06ecf75
[OpenMP] Fix incorrect KMP_STRLEN() macro

The second argument to the strnlen_s(str, size) function should be
sizeof(str) when str is a true array of characters with known size
(instead of just a char*). Use type traits to determine if first
parameter is a character array and use the correct size based on that
trait.

Differential Revision: https://reviews.llvm.org/D98209
openmp/runtime/src/kmp_os.h
openmp/runtime/src/kmp_safe_c_api.h