Explorar o código

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 %!s(int64=13) %!d(string=hai) anos
pai
achega
514f2a13bd
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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';
 	}