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