windows: fix compilation and warnings

This commit is contained in:
Bernhard Miklautz 2015-06-22 19:31:25 +02:00
parent 06502e6a91
commit af81a91ea7
6 changed files with 7 additions and 7 deletions

View File

@ -79,7 +79,7 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
if (!context->argv[index])
{
ret = 1;
for (--index; index > = 0; --index)
for (--index; index >= 0; --index)
free(context->argv[index]);
free(context->argv);
context->argv = NULL;

View File

@ -318,7 +318,7 @@ static int freerdp_client_rdp_file_set_string(rdpFile* file, const char* name, c
else
standard = 1;
if (tmp && !(*tmp = strdup(value)))
if (tmp && !(*tmp = _strdup(value)))
return -1;
if (index >= 0)

View File

@ -11,8 +11,8 @@ int TestSettings(int argc, char* argv[])
printf("Couldn't create settings\n");
return -1;
}
settings->Username = strdup("abcdefg");
settings->Password = strdup("xyz");
settings->Username = _strdup("abcdefg");
settings->Password = _strdup("xyz");
cloned = freerdp_settings_clone(settings);
if (!cloned)
{

View File

@ -120,7 +120,7 @@ int ntlm_SetContextTargetName(NTLM_CONTEXT* context, char* TargetName)
if (!GetComputerNameExA(ComputerNameDnsHostname, computerName, &nSize))
return -1;
name = strdup(computerName);
name = _strdup(computerName);
if (!name)
return -1;

View File

@ -178,7 +178,7 @@ int ntlm_get_target_computer_name(PUNICODE_STRING pName, COMPUTER_NAME_FORMAT ty
if (!GetComputerNameExA(type, computerName, &nSize))
return -1;
name = strdup(computerName);
name = _strdup(computerName);
if (!name)
return -1;

View File

@ -314,7 +314,7 @@ char* x509_get_default_name()
if (!GetComputerNameExA(ComputerNameNetBIOS, computerName, &nSize))
return NULL;
ret = strdup(computerName);
ret = _strdup(computerName);
if (!ret)
return NULL;