Skip to content

Commit

Permalink
[api] fixed UTF-16 T-Clock.ini creation/update (thanks Dmytro)
Browse files Browse the repository at this point in the history
I messed it up in commit 2042b42. This is what I get by fixing non-important Coverity warnings :P
[ci cov]
  • Loading branch information
White-Tiger committed May 21, 2017
1 parent 2c60312 commit 99d7ee2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DLL/clock_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int ForceUTF_16(wchar_t* in_name, off_t file_size) {
} UTF16file;
char* in_data;
UTF16file* out;
FILE* in_fp,* out_fp;
FILE* in_fp,* out_fp = 0;
size_t out_len, len;
wchar_t out_name[MAX_PATH];
int ret = 0;
Expand Down Expand Up @@ -127,6 +127,7 @@ static int ForceUTF_16(wchar_t* in_name, off_t file_size) {
}
out_fp = _wfopen(out_name, L"wb");
if(out_fp) {
fclose(in_fp);
++out_len;
out_len ^= fwrite(out, sizeof(wchar_t), out_len, out_fp);
fclose(out_fp);
Expand All @@ -140,7 +141,8 @@ static int ForceUTF_16(wchar_t* in_name, off_t file_size) {
free(out);
free(in_data);
}
fclose(in_fp);
if(!out_fp)
fclose(in_fp);
}
return ret;
}
Expand Down

0 comments on commit 99d7ee2

Please sign in to comment.