From f5de30ee88818d6e1345119e277b0def65a2a030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 8 Jun 2024 12:42:03 +0200 Subject: [PATCH] Fix wrong context value being used for translation lookup The trailing `]` was not being removed from the context anymore due to an off-by-one error introduced in #8430. Closes #8464. --- src/game/localization.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/localization.cpp b/src/game/localization.cpp index f6471bb83..7d65b4426 100644 --- a/src/game/localization.cpp +++ b/src/game/localization.cpp @@ -210,7 +210,7 @@ bool CLocalizationDatabase::Load(const char *pFilename, IStorage *pStorage, ICon log_error("localization", "malformed context '%s' on line %d", pLine, Line); continue; } - str_truncate(aContext, sizeof(aContext), pLine + 1, Len - 1); + str_truncate(aContext, sizeof(aContext), pLine + 1, Len - 2); pLine = LineReader.Get(); if(!pLine) {