Integrate pull request feedback

* unify fwrite usage - set nmemb to 1 and the size to the size to write.
This commit is contained in:
Bernhard Miklautz 2015-07-01 12:22:32 +02:00
parent 1cee185e3c
commit 798df32fd9
2 changed files with 4 additions and 4 deletions

View File

@ -46,8 +46,8 @@ static int prepare(const char* currentFileV2, const char* legacyFileV2, const ch
for (i=0; i<sizeof(hosts)/sizeof(hosts[0]); i++)
{
if (fwrite(hosts[i], strlen(hosts[i]), sizeof(char), fl) != sizeof(char) ||
fwrite(hosts[i], strlen(hosts[i]), sizeof(char), fc) != sizeof(char))
if (fwrite(hosts[i], strlen(hosts[i]), 1, fl) != 1 ||
fwrite(hosts[i], strlen(hosts[i]), 1, fc) != 1)
goto finish;
}
@ -63,7 +63,7 @@ static int prepare(const char* currentFileV2, const char* legacyFileV2, const ch
for (i=0; i<sizeof(legacy)/sizeof(legacy[0]); i++)
{
if (fwrite(legacy[i], strlen(legacy[i]), sizeof(char), fl) != sizeof(char))
if (fwrite(legacy[i], strlen(legacy[i]), 1, fl) != 1)
goto finish;
}

View File

@ -773,7 +773,7 @@ int win_shadow_wds_init(winShadowSubsystem* subsystem)
if (fp)
{
size = strlen(file->ConnectionString2);
if (fwrite(file->ConnectionString2, 1, size, fp) != size || fwrite("\r\n", 1, 2, fp) != 2)
if (fwrite(file->ConnectionString2, size, 1, fp) != 1 || fwrite("\r\n", 2, 1, fp) != 1)
{
fclose(fp);
WLog_ERR(TAG, "Problem writing to inv.xml");