aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-05-24 10:05:46 -0700
committerChris Robinson <[email protected]>2023-05-24 10:05:46 -0700
commitda56dd074595d6590273eeb1739f1c9bfc1b5fee (patch)
treea94a46ca4209bfdb16b4c5b02fb62da43c448611
parent49de6777205822816521bd136312dd24a0cf2512 (diff)
Increment an offset only when it's used
-rw-r--r--al/debug.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/al/debug.cpp b/al/debug.cpp
index efc7fc09..56705c65 100644
--- a/al/debug.cpp
+++ b/al/debug.cpp
@@ -471,6 +471,7 @@ FORCE_ALIGN ALuint AL_APIENTRY alGetDebugMessageLogDirectEXT(ALCcontext *context
if(avail < tocopy)
return i;
std::copy_n(entry.mMessage.data(), tocopy, logBuf+logBufWritten);
+ logBufWritten += static_cast<ALsizei>(tocopy);
}
if(sources) sources[i] = GetDebugSourceEnum(entry.mSource);
@@ -479,7 +480,6 @@ FORCE_ALIGN ALuint AL_APIENTRY alGetDebugMessageLogDirectEXT(ALCcontext *context
if(severities) severities[i] = GetDebugSeverityEnum(entry.mSeverity);
if(lengths) lengths[i] = static_cast<ALsizei>(tocopy);
- logBufWritten += static_cast<ALsizei>(tocopy);
context->mDebugLog.pop_front();
}