MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / tgetenv

Method tgetenv

UTCP/src/UT_StrOp.cpp:334–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334TCHAR * CUT_Str::tgetenv(const TCHAR *varname)
335{
336#if _MSC_VER >= 1400
337 TCHAR* retval;
338 size_t requiredSize;
339 // Get required length
340 _tgetenv_s( &requiredSize, NULL, 0, varname);
341 retval = new TCHAR[requiredSize];
342 if (!_tgetenv_s( &requiredSize, retval, requiredSize, varname ))
343 return retval;
344 else
345 {
346 delete [] retval;
347 return NULL;
348 }
349
350#else
351 return _tgetenv(varname);
352#endif
353}
354
355// v4.2 these internal mbstowcs and wcstombs are called by the AC and WC macros below.
356// For translation to wide char with code page selection (i.e CP_UTF8) see cvtcpy above.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected