All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	devel@driverdev.osuosl.org,
	Chase Southwood <chase.southwood@yahoo.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat
Date: Wed, 29 Oct 2014 16:07:55 +0800	[thread overview]
Message-ID: <20141029080755.GA6009@kroah.com> (raw)
In-Reply-To: <1413642908-3633-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Sat, Oct 18, 2014 at 04:35:08PM +0200, Rickard Strandqvist wrote:
> Changed from using strncat to strlcat to simplify the code
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> ---
>  drivers/staging/comedi/drivers/comedi_bond.c |    9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
> index 8450c99..85b2f4a 100644
> --- a/drivers/staging/comedi/drivers/comedi_bond.c
> +++ b/drivers/staging/comedi/drivers/comedi_bond.c
> @@ -61,8 +61,7 @@ struct bonded_device {
>  };
>  
>  struct comedi_bond_private {
> -# define MAX_BOARD_NAME 256
> -	char name[MAX_BOARD_NAME];
> +	char name[256];
>  	struct bonded_device **devs;
>  	unsigned ndevs;
>  	unsigned nchans;
> @@ -262,12 +261,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));
>  			}
>  
>  		}

Oops, I applied the first version of this, can you send me an updated
version with just the new changes here?

thanks,

greg k-h

      reply	other threads:[~2014-10-29 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 14:35 [PATCH v2] staging: comedi: drivers: comedi_bond.c: Changed from using strncat to strlcat Rickard Strandqvist
2014-10-29  8:07 ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141029080755.GA6009@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=abbotti@mev.co.uk \
    --cc=chase.southwood@yahoo.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.