From f28726af7479bdc3e03329b77762f20db068c86b Mon Sep 17 00:00:00 2001 From: Spoike Date: Fri, 22 Jul 2011 13:54:42 +0000 Subject: [PATCH] Trying to remove the length limit on the demobrowser filenames. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3882 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/m_single.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/client/m_single.c b/engine/client/m_single.c index b02f8146e..c568e0a64 100644 --- a/engine/client/m_single.c +++ b/engine/client/m_single.c @@ -358,11 +358,11 @@ void M_Menu_SinglePlayer_f (void) typedef struct demoitem_s { - char name[MAX_QPATH]; qboolean isdir; int size; struct demoitem_s *next; struct demoitem_s *prev; + char name[1]; } demoitem_t; typedef struct { @@ -530,7 +530,7 @@ static int DemoAddItem(const char *filename, int size, void *parm) } if (!menu->items) - menu->items = newi = BZ_Malloc(sizeof(*newi)); + menu->items = newi = BZ_Malloc(sizeof(*newi) + strlen(filename)); else { link = menu->items; @@ -546,7 +546,7 @@ static int DemoAddItem(const char *filename, int size, void *parm) { if (!link->prev) { - link->prev = newi = BZ_Malloc(sizeof(*newi)); + link->prev = newi = BZ_Malloc(sizeof(*newi) + strlen(filename)); break; } link = link->prev; @@ -555,7 +555,7 @@ static int DemoAddItem(const char *filename, int size, void *parm) { if (!link->next) { - link->next = newi = BZ_Malloc(sizeof(*newi)); + link->next = newi = BZ_Malloc(sizeof(*newi) + strlen(filename)); break; } link = link->next; @@ -563,7 +563,7 @@ static int DemoAddItem(const char *filename, int size, void *parm) } } - Q_strncpyz(newi->name, filename, sizeof(newi->name)); + strcpy(newi->name, filename); newi->size = size; newi->isdir = isdir; newi->prev = NULL;