From 34dcf6a1902ac214149a2742250ff03aa5346f3e Mon Sep 17 00:00:00 2001 From: swkhack Date: Fri, 17 May 2019 15:59:22 +0800 Subject: net: caif: fix the value of size argument of snprintf Because the function snprintf write at most size bytes(including the null byte).So the value of the argument size need not to minus one. Signed-off-by: swkhack Signed-off-by: David S. Miller --- net/caif/cfvidl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/caif/cfvidl.c') diff --git a/net/caif/cfvidl.c b/net/caif/cfvidl.c index b3b110e8a350..73615e3b3b58 100644 --- a/net/caif/cfvidl.c +++ b/net/caif/cfvidl.c @@ -29,7 +29,7 @@ struct cflayer *cfvidl_create(u8 channel_id, struct dev_info *dev_info) cfsrvl_init(vid, channel_id, dev_info, false); vid->layer.receive = cfvidl_receive; vid->layer.transmit = cfvidl_transmit; - snprintf(vid->layer.name, CAIF_LAYER_NAME_SZ - 1, "vid1"); + snprintf(vid->layer.name, CAIF_LAYER_NAME_SZ, "vid1"); return &vid->layer; } -- cgit v1.2.3-70-g09d2