summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gfx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index a69654ca1..4423bff19 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -294,7 +294,7 @@ static void HandleBiDiAndArabicShapes(char *buffer, const char *lastof)
char *t = buffer;
size_t length = 0;
- while (*t != '\0' && length < lengthof(input_output)) {
+ while (*t != '\0' && length < lengthof(input_output) - 1) {
WChar tmp;
t += Utf8Decode(&tmp, t);
input_output[length++] = tmp;