aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index d4019bc9..bb4930ee 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -308,19 +308,22 @@ void ALCcontext::sendDebugMessage(DebugSource source, DebugType type, ALuint id,
{
static_assert(DebugSeverityBase+DebugSeverityCount <= 32, "Too many debug bits");
+ /* MaxDebugMessageLength is the size including the null terminator,
+ * <length> does not include the null terminator.
+ */
if(length < 0)
{
size_t newlen{std::strlen(message)};
- if(newlen > MaxDebugMessageLength) UNLIKELY
+ if(newlen >= MaxDebugMessageLength) UNLIKELY
{
- ERR("Debug message too long (%zu > %d)\n", newlen, MaxDebugMessageLength);
+ ERR("Debug message too long (%zu >= %d)\n", newlen, MaxDebugMessageLength);
return;
}
length = static_cast<ALsizei>(newlen);
}
- else if(length > MaxDebugMessageLength) UNLIKELY
+ else if(length >= MaxDebugMessageLength) UNLIKELY
{
- ERR("Debug message too long (%d > %d)\n", length, MaxDebugMessageLength);
+ ERR("Debug message too long (%d >= %d)\n", length, MaxDebugMessageLength);
return;
}