mirror of https://github.com/FreeRDP/FreeRDP
Fixed warnings from TestEnvironmentGetEnvironmentStrings
This commit is contained in:
parent
1fb716d864
commit
b06efc78ec
|
@ -6,23 +6,33 @@
|
|||
|
||||
int TestEnvironmentGetEnvironmentStrings(int argc, char* argv[])
|
||||
{
|
||||
int r = -1;
|
||||
TCHAR* p;
|
||||
int length;
|
||||
size_t length;
|
||||
LPTCH lpszEnvironmentBlock;
|
||||
|
||||
WINPR_UNUSED(argc);
|
||||
WINPR_UNUSED(argv);
|
||||
|
||||
lpszEnvironmentBlock = GetEnvironmentStrings();
|
||||
|
||||
p = (TCHAR*) lpszEnvironmentBlock;
|
||||
|
||||
while (p[0] && p[1])
|
||||
{
|
||||
_tprintf(_T("%s\n"), p);
|
||||
const int rc = _tprintf(_T("%s\n"), p);
|
||||
if (rc < 1)
|
||||
goto fail;
|
||||
length = _tcslen(p);
|
||||
if (length != (size_t)(rc - 1))
|
||||
goto fail;
|
||||
p += (length + 1);
|
||||
}
|
||||
|
||||
r = 0;
|
||||
fail:
|
||||
FreeEnvironmentStrings(lpszEnvironmentBlock);
|
||||
|
||||
return 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue