From 7dcd346352b63e3c177452e9bc629291523fd5cf Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 5 Dec 2006 21:51:24 +0000 Subject: [PATCH] This seems like a good idea... git-svn-id: https://svn.eduke32.com/eduke32@386 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index db62f6eac..2648f0e86 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -2379,6 +2379,8 @@ char parsecommand(void) if (music_fn[k][i] == NULL) music_fn[k][i] = Bcalloc(Bstrlen(tempbuf)+1,sizeof(char)); + else if ((Bstrlen(tempbuf)+1) > sizeof(music_fn[k][i])) + music_fn[k][i] = Brealloc(music_fn[k][i],(Bstrlen(tempbuf)+1)); Bstrcpy(music_fn[k][i],tempbuf); @@ -4539,8 +4541,10 @@ repeatcase: if (level_file_names[j*MAXLEVELS+k] == NULL) level_file_names[j*MAXLEVELS+k] = Bcalloc(Bstrlen(tempbuf)+1,sizeof(char)); + else if ((Bstrlen(tempbuf)+1) > sizeof(level_file_names[j*MAXLEVELS+k])) + level_file_names[j*MAXLEVELS+k] = Brealloc(level_file_names[j*MAXLEVELS+k],(Bstrlen(tempbuf)+1)); -/* initprintf("level file name string len: %ld\n",Bstrlen(tempbuf)); */ + /* initprintf("level file name string len: %ld\n",Bstrlen(tempbuf)); */ Bstrcpy(level_file_names[j*MAXLEVELS+k],tempbuf); @@ -4579,8 +4583,10 @@ repeatcase: if (level_names[j*MAXLEVELS+k] == NULL) level_names[j*MAXLEVELS+k] = Bcalloc(Bstrlen(tempbuf)+1,sizeof(char)); + else if ((Bstrlen(tempbuf)+1) > sizeof(level_names[j*MAXLEVELS+k])) + level_names[j*MAXLEVELS+k] = Brealloc(level_names[j*MAXLEVELS+k],(Bstrlen(tempbuf)+1)); -/* initprintf("level name string len: %ld\n",Bstrlen(tempbuf)); */ + /* initprintf("level name string len: %ld\n",Bstrlen(tempbuf)); */ Bstrcpy(level_names[j*MAXLEVELS+k],tempbuf);