Skip to content

Commit

Permalink
Patched log writing to remove spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasecoulls committed Oct 4, 2023
1 parent def921d commit 8697920
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions LogBazooka/LogRoutines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ void SaveLog(HWND hEdit, HWND MainWindow)
MessageBox(MainWindow, L"Error opening file.", L"Error", MB_ICONERROR);
return;
}

// Write the text to the file.

// Write the BOM for UTF-16
BYTE bom[] = { 0xFF, 0xFE };
DWORD dwBytesWritten = 0;
WriteFile(hFile, buffer, len * sizeof(TCHAR), &dwBytesWritten, NULL);

WriteFile(hFile, bom, sizeof(bom), &dwBytesWritten, NULL);

// Write the text to the file.
WriteFile(hFile, buffer, len * sizeof(wchar_t), &dwBytesWritten, NULL);

// Close the file.
CloseHandle(hFile);

Expand Down

0 comments on commit 8697920

Please sign in to comment.