polymer.c: Fix a potential zero-size calloc call when a two-walled sector

is present (like in E4L1).  Also sneak in a trivial change in cache1d.c

git-svn-id: https://svn.eduke32.com/eduke32@2010 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-09-06 17:46:34 +00:00
parent dc02ff5654
commit 843689f8a0
2 changed files with 3 additions and 3 deletions

View file

@ -969,14 +969,14 @@ CACHE1D_FIND_REC *klistpath(const char *_path, const char *mask, int32_t type)
do
{
strcpy(buf, d);
if (!pathsearchmode)
{
// Fix for "autoload" dir in multi-user environments - NY00123
strcpy(buf, d);
strcat(buf, path);
if (*path) strcat(buf, "/");
}
else strcpy(buf, d);
dir = Bopendir(buf);
if (dir)
{

View file

@ -2448,7 +2448,7 @@ static int32_t polymer_buildfloor(int16_t sectnum)
if (s->floor.indices == NULL)
{
s->indicescount = (sec->wallnum - 2) * 3;
s->indicescount = (max(3, sec->wallnum) - 2) * 3;
s->floor.indices = Bcalloc(s->indicescount, sizeof(GLushort));
s->ceil.indices = Bcalloc(s->indicescount, sizeof(GLushort));
}