(svn r3285) -Codechange: Tron was confused by a name, so let's make him happy,
authortruelight
Sat, 10 Dec 2005 18:50:07 +0000
changeset 2740 4f48b7ad85ba
parent 2739 6a2caa243d5c
child 2741 65d4de069014
(svn r3285) -Codechange: Tron was confused by a name, so let's make him happy,
prefixed it with 'tmp', so now we know it is a temp char* :)
ai/ai.c
--- a/ai/ai.c	Sat Dec 10 18:47:40 2005 +0000
+++ b/ai/ai.c	Sat Dec 10 18:50:07 2005 +0000
@@ -99,7 +99,7 @@
 {
 	PlayerID old_lp;
 	int32 res = 0;
-	char *cmdtext = NULL;
+	char *tmp_cmdtext = NULL;
 
 	/* If you enable DC_EXEC with DC_QUERY_COST you are a really strange
 	 *   person.. should we check for those funny jokes?
@@ -107,20 +107,20 @@
 
 	/* The test already free _cmd_text in most cases, so let's backup the string, else we have a problem ;) */
 	if (_cmd_text != NULL)
-		cmdtext = strdup(_cmd_text);
+		tmp_cmdtext = strdup(_cmd_text);
 
 	/* First, do a test-run to see if we can do this */
 	res = DoCommandByTile(tile, p1, p2, flags & ~DC_EXEC, procc);
 	/* The command failed, or you didn't want to execute, or you are quering, return */
 	if ((CmdFailed(res)) || !(flags & DC_EXEC) || (flags & DC_QUERY_COST)) {
-		if (cmdtext != NULL)
-			free(cmdtext);
+		if (tmp_cmdtext != NULL)
+			free(tmp_cmdtext);
 		return res;
 	}
 
 	/* Recover _cmd_text */
-	if (cmdtext != NULL)
-		_cmd_text = cmdtext;
+	if (tmp_cmdtext != NULL)
+		_cmd_text = tmp_cmdtext;
 
 	/* If we did a DC_EXEC, and the command did not return an error, execute it
 	    over the network */
@@ -147,8 +147,8 @@
 	_local_player = old_lp;
 
 	/* Free the temp _cmd_text var */
-	if (cmdtext != NULL)
-		free(cmdtext);
+	if (tmp_cmdtext != NULL)
+		free(tmp_cmdtext);
 
 	return res;
 }