mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
w32: Use _putenv_s.
* common/sysutils.c (gnupg_setenv): Use _putenv_s. -- This may break build on original MinGW, but works well with MinGW-W64. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
5c7c6065f3
commit
86cdb49097
@ -1148,6 +1148,19 @@ gnupg_setenv (const char *name, const char *value, int overwrite)
|
||||
return setenv (name, value, overwrite);
|
||||
#else /*!HAVE_SETENV*/
|
||||
if (! getenv (name) || overwrite)
|
||||
#ifdef HAVE_W32_SYSTEM
|
||||
{
|
||||
int e = _putenv_s (name, value);
|
||||
|
||||
if (e)
|
||||
{
|
||||
gpg_err_set_errno (e);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
{
|
||||
char *buf;
|
||||
|
||||
@ -1165,6 +1178,7 @@ gnupg_setenv (const char *name, const char *value, int overwrite)
|
||||
# endif
|
||||
return putenv (buf);
|
||||
}
|
||||
#endif /*!HAVE_W32_SYSTEM*/
|
||||
return 0;
|
||||
#endif /*!HAVE_SETENV*/
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user