From: Rickard Strandqvist Date: Sun, 12 Oct 2014 12:23:24 +0000 (+0200) Subject: staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=42170711b7190824a7458b0719353912c9199bfc;p=linux-beck.git staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat Changed from using strncat to strlcat to simplify the code Signed-off-by: Rickard Strandqvist Reviewed-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index 8450c99af8b0..5d19861fbabc 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -262,12 +262,10 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) { /* Append dev:subdev to devpriv->name */ char buf[20]; - int left = - MAX_BOARD_NAME - strlen(devpriv->name) - 1; snprintf(buf, sizeof(buf), "%u:%u ", bdev->minor, bdev->subdev); - buf[sizeof(buf) - 1] = 0; - strncat(devpriv->name, buf, left); + strlcat(devpriv->name, buf, + sizeof(devpriv->name)); } }