aboutsummaryrefslogtreecommitdiff
path: root/src/dutil/logutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dutil/logutil.cpp')
-rw-r--r--src/dutil/logutil.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dutil/logutil.cpp b/src/dutil/logutil.cpp
index 35251274..ac68036a 100644
--- a/src/dutil/logutil.cpp
+++ b/src/dutil/logutil.cpp
@@ -776,11 +776,15 @@ extern "C" HRESULT LogStringWorkRaw(
776 Assert(szLogData && *szLogData); 776 Assert(szLogData && *szLogData);
777 777
778 HRESULT hr = S_OK; 778 HRESULT hr = S_OK;
779 size_t cchLogData = 0;
779 DWORD cbLogData = 0; 780 DWORD cbLogData = 0;
780 DWORD cbTotal = 0; 781 DWORD cbTotal = 0;
781 DWORD cbWrote = 0; 782 DWORD cbWrote = 0;
782 783
783 cbLogData = lstrlenA(szLogData); 784 hr = ::StringCchLengthA(szLogData, STRSAFE_MAX_CCH, &cchLogData);
785 LoguExitOnRootFailure(hr, "Failed to get length of raw string");
786
787 cbLogData = (DWORD)cchLogData;
784 788
785 // If the log hasn't been initialized yet, store it in a buffer 789 // If the log hasn't been initialized yet, store it in a buffer
786 if (INVALID_HANDLE_VALUE == LogUtil_hLog) 790 if (INVALID_HANDLE_VALUE == LogUtil_hLog)