Fix segfault when filename lacks extension
and don't mix up fullname with longname
This commit is contained in:
parent
be35926843
commit
d6299d8394
2 changed files with 2 additions and 6 deletions
|
|
@ -382,11 +382,7 @@ static inline boolean CheckCompatFilename(const char *filename)
|
|||
static inline boolean CheckCompatExtension(const char *filename)
|
||||
{
|
||||
char *basename = strrchr(filename, '.');
|
||||
|
||||
if (!stricmp(basename+1, "KART"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return basename && !stricmp(basename+1, "KART");
|
||||
}
|
||||
|
||||
static inline boolean CheckCompatSkins(UINT16 wadnum)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ struct wadfile_t
|
|||
{
|
||||
char *filename;
|
||||
restype_t type;
|
||||
UINT32 *lumphashes; // hashes for every lump's fullname in ALL CAPS
|
||||
UINT32 *lumphashes; // hashes for every lump's longname in ALL CAPS
|
||||
lumpinfo_t *lumpinfo;
|
||||
lumpcache_t *lumpcache;
|
||||
lumpcache_t *patchcache;
|
||||
|
|
|
|||
Loading…
Reference in a new issue