/pidgin/main: f38a5005e8a8: Don't reuse the n2 variable.

Mark Doliner mark at kingant.net
Wed Oct 22 10:20:23 EDT 2014


Changeset: f38a5005e8a8f38350f41642842d22acb726b95e
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2014-03-04 23:01 -0800
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/f38a5005e8a8

Description:

Don't reuse the n2 variable.

Use a separate variable, just to avoid confusion. Local variables
are EXTREMELY cheap, since they're just an address on the stack.

Using separate variables for separate uses reduces chances of bugs.

diffstat:

 pidgin/win32/untar.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (27 lines):

diff --git a/pidgin/win32/untar.c b/pidgin/win32/untar.c
--- a/pidgin/win32/untar.c
+++ b/pidgin/win32/untar.c
@@ -496,18 +496,19 @@ static int untar_block(Uchar_t *blk) {
 		 */
 		if (tblk->type == '5')
 		{
+			char *tmp;
 			if (LISTING)
-				n2 = " directory";
+				tmp = " directory";
 #ifdef _POSIX_SOURCE
 			else if (mkdir(nbuf, mode) == 0)
 #else
 			else if (g_mkdir(nbuf, 0755) == 0)
 #endif
-				n2 = " created";
+				tmp = " created";
 			else
-				n2 = " ignored";
+				tmp = " ignored";
 			if (VERBOSE)
-				untar_verbose("%s\n", n2);
+				untar_verbose("%s\n", tmp);
 			return 1;
 		}
 



More information about the Commits mailing list