All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] argv_split: allow argv_split to handle NULL pointer in argcp parameter gracefully
Date: Tue, 31 Jul 2007 09:56:35 -0700	[thread overview]
Message-ID: <46AF69C3.1040900@goop.org> (raw)
In-Reply-To: <20070731164608.GB28333@hmsreliant.homelinux.net>

Neil Horman wrote:
> As Jeremy and I had discussed in a previous thread, it would be nice if the
> argv_split library function could gracefully handle a NULL pointer in the argcp
> parameter, so as to allow functions using it that did not care about the value
> of argc to not have to declare a useless variable.  This patch accomplishes
> that.  Tested by me, with successful results.
>   

Oh, one other thing.  Could you do a patch to clean up the use in the
usermodehelper code?

    J
> Thanks & Regards
> Neil
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
>
>
>  argv_split.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
>
> diff --git a/lib/argv_split.c b/lib/argv_split.c
> index 4096ed4..fad6ce4 100644
> --- a/lib/argv_split.c
> +++ b/lib/argv_split.c
> @@ -75,7 +75,9 @@ char **argv_split(gfp_t gfp, const char *str, int *argcp)
>  	if (argv == NULL)
>  		goto out;
>  
> -	*argcp = argc;
> +	if (argcp)
> +		*argcp = argc;
> +
>  	argvp = argv;
>  
>  	while (*str) {
>   


  parent reply	other threads:[~2007-07-31 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-31 16:46 [PATCH] argv_split: allow argv_split to handle NULL pointer in argcp parameter gracefully Neil Horman
2007-07-31 16:52 ` Jeremy Fitzhardinge
2007-07-31 16:56 ` Jeremy Fitzhardinge [this message]
2007-07-31 17:12   ` Neil Horman
2007-07-31 17:36 ` Satyam Sharma
2007-07-31 18:14   ` Neil Horman

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=46AF69C3.1040900@goop.org \
    --to=jeremy@goop.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhorman@tuxdriver.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.