From da56dd074595d6590273eeb1739f1c9bfc1b5fee Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 24 May 2023 10:05:46 -0700 Subject: Increment an offset only when it's used --- al/debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'al/debug.cpp') 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(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(tocopy); - logBufWritten += static_cast(tocopy); context->mDebugLog.pop_front(); } -- cgit v1.2.3