summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gettext-tools/src/x-lua.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gettext-tools/src/x-lua.c b/gettext-tools/src/x-lua.c
index 0399c49..78ac24f 100644
--- a/gettext-tools/src/x-lua.c
+++ b/gettext-tools/src/x-lua.c
@@ -451,6 +451,12 @@ string_add (int c)
static void
string_end ()
{
+ if (string_buf_length >= string_buf_alloc)
+ {
+ string_buf_alloc = string_buf_alloc + 1;
+ string_buf = xrealloc (string_buf, string_buf_alloc);
+ }
+
string_buf[string_buf_length] = '\0';
}