Skip to content
This repository has been archived by the owner on Jun 16, 2019. It is now read-only.

Commit

Permalink
Fix crash when loading a map file with no extension.
Browse files Browse the repository at this point in the history
Doesn't work anyway but shouldn't crash either.
  • Loading branch information
mfn committed Jan 3, 2010
1 parent 7f763ad commit f29f2e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion radiant/map.cpp
Expand Up @@ -576,7 +576,11 @@ void Map_LoadFile (const char *filename)
// prepare to let the map module do the parsing
FileStream file;
const char* type = strrchr(filename,'.');
if(type!=NULL) type++;
if (type == NULL) {
type = "";
} else {
type++;
}
// NOTE TTimo opening has binary doesn't make a lot of sense
// but opening as text confuses the scriptlib parser
// this may be a problem if we "rb" and use the XML parser, might have an incompatibility
Expand Down

0 comments on commit f29f2e9

Please sign in to comment.