curlx: replace mbstowcs/wcstombs with _s counterparts (Windows)

They are used in Windows-specific `fopen()`, `freopen`, `open()` and
`curlx_get_winapi_error()` calls, and in `fix_excessive_path()` in
Unicode builds.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-mbstowcs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-s-mbstowcs-s-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-wcstombs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-s-wcstombs-s-l

Also ban these functions via checksrc.

Co-authored-by: Jay Satiro

Closes #19581
This commit is contained in:
Viktor Szakats
2025-11-18 01:48:04 +01:00
parent acfcc2b288
commit 18b9429313
4 changed files with 28 additions and 29 deletions

View File

@@ -86,6 +86,8 @@ my %banfunc = (
"wcsdup" => 1,
"wcscpy" => 1,
"wcsncpy" => 1,
"mbstowcs" => 1,
"wcstombs" => 1,
"LoadLibrary" => 1,
"LoadLibraryA" => 1,
"LoadLibraryW" => 1,