MEX files: disable clang-tidy false positive for call to std::strcpy

new-samplers
Sébastien Villemot 2023-12-06 16:59:46 +01:00
parent 91f2dcdfe1
commit 6a58316a3e
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ mexFunction(int nlhs, [[maybe_unused]] mxArray* plhs[], int nrhs, const mxArray*
if (!(args[nargs] = static_cast<char*>(mxCalloc(strlen(mainarg) + 1, sizeof(char)))))
mexErrMsgTxt("Error in MS-SBVAR MEX file: could not allocate memory. (2)");
strcpy(args[nargs++], mainarg);
// Disabling security warning, since by construction the destination is large enough
strcpy(args[nargs++], mainarg); // NOLINT(clang-analyzer-security.insecureAPI.strcpy)
if (mxGetString(prhs[0], argument, mxGetN(prhs[0]) + 1))
mexErrMsgTxt("Error in MS-SBVAR MEX file: error using mxGetString.\n");