mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-18 18:52:16 +00:00
ReplaceStrncpy (#4823)
* replace strncpy with strlcpy * keep strncpy to linux * cancel reseting of string ending for strlcpy Co-authored-by: Randy <Randy@randysmac.attlocal.net> Co-authored-by: RandySheriffH <rashuai@microsoft.com>
This commit is contained in:
parent
32a5f3d5b6
commit
6a360bad6b
1 changed files with 6 additions and 3 deletions
|
|
@ -1602,10 +1602,13 @@ ORT_API_STATUS_IMPL(OrtApis::GetAvailableProviders, _Outptr_ char*** out_ptr,
|
|||
if (out[i]) {
|
||||
#ifdef _MSC_VER
|
||||
strncpy_s(out[i], MAX_LEN, providers_available[i], MAX_LEN);
|
||||
#else
|
||||
strncpy(out[i], providers_available[i], MAX_LEN);
|
||||
#endif
|
||||
out[i][MAX_LEN] = '\0';
|
||||
#elif defined(__APPLE__)
|
||||
strlcpy(out[i], providers_available[i], MAX_LEN);
|
||||
#else
|
||||
strncpy(out[i], providers_available[i], MAX_LEN);
|
||||
out[i][MAX_LEN] = '\0';
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue