[Quake2world-dev] r363 - quake2world/branches/menu/src

mattn at jdolan.dyndns.org mattn at jdolan.dyndns.org
Sat Apr 18 13:05:06 UTC 2009


Author: mattn
Date: 2009-04-18 13:05:03 +0000 (Sat, 18 Apr 2009)
New Revision: 363

Modified:
   quake2world/branches/menu/src/cl_main.c
Log:
* fixed menu parsing

Modified: quake2world/branches/menu/src/cl_main.c
===================================================================
--- quake2world/branches/menu/src/cl_main.c	2009-04-18 12:58:17 UTC (rev 362)
+++ quake2world/branches/menu/src/cl_main.c	2009-04-18 13:05:03 UTC (rev 363)
@@ -887,13 +887,16 @@
 }
 
 static void CL_InitMenu(const char *filename){
+	char *buffer;
 	const char *buf;
 	const char *token;
 
 	// load the file header
-	if(Fs_LoadFile(filename, (void **)(char *)&buf) == -1)
+	if(Fs_LoadFile(filename, (void **)(char *)&buffer) == -1)
 		Sys_Error("Failed to open %s\n", filename);
 
+	buf = buffer;
+
 	token = Com_Parse(&buf);
 	if (strcmp(token, "window"))
 		Sys_Error("Failed to parse %s\n", filename);
@@ -901,7 +904,7 @@
 	token = Com_Parse(&buf);
 	MN_ParseMenu("window", token, &buf);
 
-	Fs_FreeFile(&buf);
+	Fs_FreeFile(buffer);
 }
 
 /*



More information about the Quake2World-dev mailing list