plug-ins: Use fopen_s on Windows to fix CRT_INSECURE_DEPRECATE warns

This commit is contained in:
Bruno Lopes 2026-03-31 22:16:25 -03:00
parent f14f9516e2
commit f4969c2f80

View file

@ -64,10 +64,22 @@ main (int argc, char *argv[])
{
file = stdout;
}
else if (! (file = fopen (argv[1], "w")))
else
{
perror (argv[1]);
return 1;
#ifndef _UCRT
if (! (file = fopen (argv[1], "w")))
{
perror (argv[1]);
return 1;
}
#else
if (fopen_s (&file, argv[1], "w") != 0)
{
file = NULL;
perror (argv[1]);
return 1;
}
#endif
}
}
else