All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: core: No need to use strncmp()
Date: Wed, 31 Jul 2013 12:59:29 +0100	[thread overview]
Message-ID: <20130731115929.GA26438@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20130731110147.GI9858@sirena.org.uk>

On Wed, Jul 31, 2013 at 12:01:47PM +0100, Mark Brown wrote:
> On Wed, Jul 31, 2013 at 10:48:14AM +0100, Dimitris Papastamos wrote:
> > On Wed, Jul 31, 2013 at 10:07:26AM +0100, Mark Brown wrote:
> > > On Wed, Jul 31, 2013 at 09:44:13AM +0100, Dimitris Papastamos wrote:
> > > > Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
> 
> > > Why?
> 
> > Hm, strncmp() suggests that we might not care about the entire string.
> > Although trivial, I thought strcmp() is clearer in this context.
> 
> One of the reasons we use strncmp() here is to avoid going beyond the
> end of the fixed size buffer.

Right, surely though the kcontrol names are always null terminated?
In any case, looks more safe to strncmp().

  reply	other threads:[~2013-07-31 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  8:44 [PATCH] ASoC: core: No need to use strncmp() Dimitris Papastamos
2013-07-31  9:07 ` Mark Brown
2013-07-31  9:48   ` Dimitris Papastamos
2013-07-31 11:01     ` Mark Brown
2013-07-31 11:59       ` Dimitris Papastamos [this message]
2013-07-31 13:23         ` Mark Brown

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=20130731115929.GA26438@opensource.wolfsonmicro.com \
    --to=dp@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    /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.