From: Rudolf Polzer Date: Mon, 23 Aug 2010 19:41:42 +0000 (+0200) Subject: fix gamedetect NULL pointer X-Git-Tag: xonotic-v0.5.0~230 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=61c6265531f23c774238a3700d80f843ca19346b;p=xonotic%2Fnetradiant.git fix gamedetect NULL pointer --- diff --git a/radiant/environment.cpp b/radiant/environment.cpp index 220a884f..04033579 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -88,10 +88,13 @@ bool gamedetect_check_game(char *gamefile, const char *checkfile1, const char *c if(!file_exists(buf)) return false; - strcpy(buf + bufpos + 1, checkfile2); - globalOutputStream() << "Checking for a game file in " << buf << "\n"; - if(!file_exists(buf)) - return false; + if(checkfile2) + { + strcpy(buf + bufpos + 1, checkfile2); + globalOutputStream() << "Checking for a game file in " << buf << "\n"; + if(!file_exists(buf)) + return false; + } buf[bufpos + 1] = 0; gamedetect_found_game(gamefile, buf);