Browse Source

testcpg: fix build warning

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 13 năm trước cách đây
mục cha
commit
514f2a13bd
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      test/testcpg.c

+ 2 - 1
test/testcpg.c

@@ -105,8 +105,9 @@ print_time(void)
 
 	len = sizeof(hostname);
 	if(gethostname(hostname, len) == 0) {
+		char *longName;
 		hostname[len-1] = '\0';
-		char *longName = hostname;
+		longName = hostname;
 		if( (longName = strstr( hostname, "." )) != NULL )
 		*longName = '\0';
 	}