From 1ed370ac4a95fe41d43c3369f99856d876801984 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Sun, 5 Mar 2006 03:50:54 +0000 Subject: [PATCH] assure that bsp entity lumps are null terminated (fix 2fort5p loading), cosmetic fix git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2051 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/tlout.h | 4 ++-- engine/common/translate.c | 4 ++-- engine/gl/gl_model.c | 3 ++- engine/server/svmodel.c | 3 ++- engine/sw/sw_model.c | 3 ++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/engine/common/tlout.h b/engine/common/tlout.h index 982cf04c3..c6bd23c7d 100644 --- a/engine/common/tlout.h +++ b/engine/common/tlout.h @@ -17,8 +17,8 @@ "STL_NOCLIPON \"noclip ON\\n\"\n" "STL_NOCLIPOFF \"noclip OFF\"\n" "STL_CLIENTISCUFFEDPERMANENTLY \"%s is still cuffed\\n\"\n" -"STL_CLIENTISCUFFED \"%s was cuffed\\n\"\n" -"STL_CLIENTISSTILLCUFFED \"%s is still cuffed\\n\"\n" +"STL_CLIENTISCUFFED \"%s is cuffed\\n\"\n" +"STL_CLIENTISSTILLCUFFED \"%s is now cuffed permanently\\n\"\n" "STL_YOUWERECUFFED \"You were cuffed\\n\"\n" "STL_YOUARNTCUFFED \"You are no longer cuffed\\n\"\n" "STL_CLIENTISCRIPPLEDPERMANENTLY \"%s is now crippled permanently\\n\"\n" diff --git a/engine/common/translate.c b/engine/common/translate.c index 03f7dd598..febf68179 100644 --- a/engine/common/translate.c +++ b/engine/common/translate.c @@ -25,8 +25,8 @@ static char *defaultlanguagetext = "STL_NOCLIPON \"noclip ON\\n\"\n" "STL_NOCLIPOFF \"noclip OFF\"\n" "STL_CLIENTISCUFFEDPERMANENTLY \"%s is still cuffed\\n\"\n" -"STL_CLIENTISCUFFED \"%s was cuffed\\n\"\n" -"STL_CLIENTISSTILLCUFFED \"%s is still cuffed\\n\"\n" +"STL_CLIENTISCUFFED \"%s is cuffed\\n\"\n" +"STL_CLIENTISSTILLCUFFED \"%s is now cuffed permanently\\n\"\n" "STL_YOUWERECUFFED \"You were cuffed\\n\"\n" "STL_YOUARNTCUFFED \"You are no longer cuffed\\n\"\n" "STL_CLIENTISCRIPPLEDPERMANENTLY \"%s is now crippled permanently\\n\"\n" diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 31e1a6187..6deb3f0fa 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -1470,8 +1470,9 @@ void GLMod_LoadEntities (lump_t *l) loadmodel->entities = NULL; return; } - loadmodel->entities = Hunk_AllocName ( l->filelen, loadname); + loadmodel->entities = Hunk_AllocName ( l->filelen + 1, loadname); memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen); + loadmodel->entities[l->filelen] = 0; } diff --git a/engine/server/svmodel.c b/engine/server/svmodel.c index 6cd47cb13..a420ad930 100644 --- a/engine/server/svmodel.c +++ b/engine/server/svmodel.c @@ -545,8 +545,9 @@ void Mod_LoadEntities (lump_t *l) loadmodel->entities = NULL; return; } - loadmodel->entities = Hunk_AllocName ( l->filelen, loadname); + loadmodel->entities = Hunk_AllocName ( l->filelen + 1, loadname); memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen); + loadmodel->entities[l->filelen] = 0; } diff --git a/engine/sw/sw_model.c b/engine/sw/sw_model.c index 00602a294..e0b73a1c6 100644 --- a/engine/sw/sw_model.c +++ b/engine/sw/sw_model.c @@ -950,8 +950,9 @@ void SWMod_LoadEntities (lump_t *l) loadmodel->entities = NULL; return; } - loadmodel->entities = Hunk_AllocName ( l->filelen, loadname); + loadmodel->entities = Hunk_AllocName ( l->filelen + 1, loadname); memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen); + loadmodel->entities[l->filelen] = 0; }