Skip to content

Commit

Permalink
net: vlan: Use sizeof instead of literal number
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gao Feng authored and David S. Miller committed Oct 18, 2016
1 parent 7cafb0b commit 9c403b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 9c403b6

Please sign in to comment.