net: vlan: Use sizeof instead of literal number
authorGao Feng <fgao@ikuai8.com>
Tue, 18 Oct 2016 00:57:50 +0000 (08:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Oct 2016 18:23:23 +0000 (14:23 -0400)
Use sizeof variable instead of literal number to enhance the readability.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/8021q/vlan.c

index f8903c1e10109a734a99172f696c233ad37867cf..9accde339601e6d736a281793ccf19d805a10df7 100644 (file)
@@ -515,8 +515,8 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg)
                return -EFAULT;
 
        /* Null terminate this sucker, just in case. */
-       args.device1[23] = 0;
-       args.u.device2[23] = 0;
+       args.device1[sizeof(args.device1) - 1] = 0;
+       args.u.device2[sizeof(args.u.device2) - 1] = 0;
 
        rtnl_lock();