From 737156659252c2ed6adc20bfd4eaa0e4b959b7d4 Mon Sep 17 00:00:00 2001
From: LJ Sonic <lamr@free.fr>
Date: Sat, 16 Mar 2024 19:35:56 +0100
Subject: [PATCH] Fix error message for too long sprite names

---
 src/deh_lua.c | 2 +-
 src/deh_soc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/deh_lua.c b/src/deh_lua.c
index 0d5f48ce11..64fb52fc74 100644
--- a/src/deh_lua.c
+++ b/src/deh_lua.c
@@ -62,7 +62,7 @@ static inline int lib_freeslot(lua_State *L)
 			spritenum_t j;
 
 			if (strlen(word) > MAXSPRITENAME)
-				return luaL_error(L, "Sprite name is longer than %s characters\n", sizeu1(strlen(word)));
+				return luaL_error(L, "Sprite name is longer than %d characters\n", MAXSPRITENAME);
 
 			for (j = SPR_FIRSTFREESLOT; j <= SPR_LASTFREESLOT; j++)
 			{
diff --git a/src/deh_soc.c b/src/deh_soc.c
index 6e4c087d54..d1643fd4ed 100644
--- a/src/deh_soc.c
+++ b/src/deh_soc.c
@@ -441,7 +441,7 @@ void readfreeslots(MYFILE *f)
 			else if (fastcmp(type, "SPR"))
 			{
 				if (strlen(word) > MAXSPRITENAME)
-					I_Error("Sprite name is longer than %s characters\n", sizeu1(strlen(word)));
+					I_Error("Sprite name is longer than %d characters\n", MAXSPRITENAME);
 
 				for (i = SPR_FIRSTFREESLOT; i <= SPR_LASTFREESLOT; i++)
 				{
-- 
GitLab