Explorar o código

gre: minor cleanups

Use strcpy() rather the sprintf() for the case where name is getting
generated.  Fix indentation.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
stephen hemminger %!s(int64=14) %!d(string=hai) anos
pai
achega
407d6fcbfd
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      net/ipv4/ip_gre.c

+ 2 - 2
net/ipv4/ip_gre.c

@@ -405,11 +405,11 @@ static struct ip_tunnel *ipgre_tunnel_locate(struct net *net,
 	if (parms->name[0])
 		strlcpy(name, parms->name, IFNAMSIZ);
 	else
-		sprintf(name, "gre%%d");
+		strcpy(name, "gre%d");
 
 	dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup);
 	if (!dev)
-	  return NULL;
+		return NULL;
 
 	dev_net_set(dev, net);