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
This commit is contained in:
Spoike 2011-07-22 13:54:42 +00:00
parent 8ea074e55e
commit f28726af74
1 changed files with 5 additions and 5 deletions

View File

@ -358,11 +358,11 @@ void M_Menu_SinglePlayer_f (void)
typedef struct demoitem_s { typedef struct demoitem_s {
char name[MAX_QPATH];
qboolean isdir; qboolean isdir;
int size; int size;
struct demoitem_s *next; struct demoitem_s *next;
struct demoitem_s *prev; struct demoitem_s *prev;
char name[1];
} demoitem_t; } demoitem_t;
typedef struct { typedef struct {
@ -530,7 +530,7 @@ static int DemoAddItem(const char *filename, int size, void *parm)
} }
if (!menu->items) if (!menu->items)
menu->items = newi = BZ_Malloc(sizeof(*newi)); menu->items = newi = BZ_Malloc(sizeof(*newi) + strlen(filename));
else else
{ {
link = menu->items; link = menu->items;
@ -546,7 +546,7 @@ static int DemoAddItem(const char *filename, int size, void *parm)
{ {
if (!link->prev) if (!link->prev)
{ {
link->prev = newi = BZ_Malloc(sizeof(*newi)); link->prev = newi = BZ_Malloc(sizeof(*newi) + strlen(filename));
break; break;
} }
link = link->prev; link = link->prev;
@ -555,7 +555,7 @@ static int DemoAddItem(const char *filename, int size, void *parm)
{ {
if (!link->next) if (!link->next)
{ {
link->next = newi = BZ_Malloc(sizeof(*newi)); link->next = newi = BZ_Malloc(sizeof(*newi) + strlen(filename));
break; break;
} }
link = link->next; 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->size = size;
newi->isdir = isdir; newi->isdir = isdir;
newi->prev = NULL; newi->prev = NULL;