]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
fix gamedetect NULL pointer
authorRudolf Polzer <divverent@alientrap.org>
Mon, 23 Aug 2010 19:41:42 +0000 (21:41 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 23 Aug 2010 19:41:42 +0000 (21:41 +0200)
radiant/environment.cpp

index 220a884f8d0a7e74c079bbbfbaaaebc2bc5a2021..040335794d339fd627ce91c0924e804243883823 100644 (file)
@@ -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);