Re: msvcrt: Implement getenv_s and _wgetenv_s, forwards from msvcr80, 90 and 100
23 Jun
2010
23 Jun
'10
5:12 p.m.
On 06/23/10 15:26, Paul Chitescu wrote:
/********************************************************************* + * getenv_s - not exported in native msvcrt + */ +int CDECL getenv_s(size_t *size, char *buffer, size_t bufLen, const char *name Both getenv_s and _wgetenv_s are exported in native msvcrt.
+ unsigned int len = strlen(var) + 1; + *size = len; + if (len > bufLen) + return MSVCRT_ERANGE; If bufLen is set to 0 the function is used for obtaining output size. No ERANGE error is returned in this case.
Cheers, Piotr
5654
Age (days ago)
5654
Last active (days ago)
0 comments
1 participants
participants (1)
-
Piotr Caban