From 02ec5566024de75e6ea9bc3912f978317baf9272 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 11 Jan 2026 05:50:28 +0200
Subject: [PATCH 62/62] Apply patch 2 for lua-5.5.0

See RM #1895

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 dependencies/lua-5.5/Version.txt   | 2 +-
 dependencies/lua-5.5/src/lstrlib.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dependencies/lua-5.5/Version.txt b/dependencies/lua-5.5/Version.txt
index fc377a6af9..75b470fa99 100644
--- a/dependencies/lua-5.5/Version.txt
+++ b/dependencies/lua-5.5/Version.txt
@@ -2,7 +2,7 @@ Sources here are from lua-5.5.0
 (http://www.lua.org/ftp/lua-5.5.0.tar.gz)
 
 Upstream bug fixes from https://www.lua.org/bugs.html applied:
-1
+1, 2
 
 Not entire lua distribution directory hierarchy is included here, and
 some files needed for Freeciv usage have been added.
diff --git a/dependencies/lua-5.5/src/lstrlib.c b/dependencies/lua-5.5/src/lstrlib.c
index 23df839ea0..beca98db83 100644
--- a/dependencies/lua-5.5/src/lstrlib.c
+++ b/dependencies/lua-5.5/src/lstrlib.c
@@ -1726,7 +1726,7 @@ static int str_packsize (lua_State *L) {
     luaL_argcheck(L, opt != Kstring && opt != Kzstr, 1,
                      "variable-length format");
     size += ntoalign;  /* total space used by option */
-    luaL_argcheck(L, totalsize <= LUA_MAXINTEGER - size,
+    luaL_argcheck(L, totalsize <= MAX_SIZE - size,
                      1, "format result too large");
     totalsize += size;
   }
-- 
2.51.0

