gre: minor cleanups
authorstephen hemminger <shemminger@vyatta.com>
Mon, 29 Nov 2010 09:47:47 +0000 (09:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Dec 2010 20:53:22 +0000 (12:53 -0800)
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>
net/ipv4/ip_gre.c

index 897210adaa772f5cbb9721d80583c07ff7e4312b..98769c399d9eb6267207e7a6249788d4fea30196 100644 (file)
@@ -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);