[misc] do not declare _CRT_SECURE_NO_WARNINGS and use secure functions

* From NickPapagiorgio/rufus@c144d76852
This commit is contained in:
Johannes Holzhäuer 2015-08-26 14:49:35 +02:00 committed by Pete Batard
parent 16d178e720
commit 387b1fbce7
6 changed files with 38 additions and 22 deletions

View file

@ -74,7 +74,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
@ -90,7 +90,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@ -103,7 +103,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>
@ -117,7 +117,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>HAVE_STRING_H;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>HAVE_STRING_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>28252;28253</DisableSpecificWarnings>

View file

@ -391,6 +391,8 @@ _getopt_initialize (argc, argv, optstring)
char *const *argv;
const char *optstring;
{
size_t posixly_correct_size = 0;
char posixly_correct_buffer[16];
/* Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
@ -399,7 +401,9 @@ _getopt_initialize (argc, argv, optstring)
nextchar = NULL;
posixly_correct = getenv ("POSIXLY_CORRECT");
if ((getenv_s(&posixly_correct_size, posixly_correct_buffer, sizeof(posixly_correct_buffer),
"POSIXLY_CORRECT") == 0) && (posixly_correct_size != 0))
posixly_correct = _strdup(posixly_correct_buffer);
/* Determine how to handle the ordering of options and nonoptions. */