Linux Netfilter development
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Eric Leblond <eric@inl.fr>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [ULOGD PATCH 3/5] Enable reading of hex or dec integer in config file.
Date: Fri, 06 Jun 2008 15:23:42 +0200	[thread overview]
Message-ID: <48493A5E.2060109@trash.net> (raw)
In-Reply-To: <1212758035-19538-4-git-send-email-eric@inl.fr>

Eric Leblond wrote:
> The config file parsing was not able to parse integer given in hex notation.
> This patch modify the parsing of configfile to be able to use different
> integers notation.
> 
> Signed-off-by: Eric Leblond <eric@inl.fr>
> ---
>  src/conffile.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/conffile.c b/src/conffile.c
> index b74da68..075b867 100644
> --- a/src/conffile.c
> +++ b/src/conffile.c
> @@ -115,6 +115,7 @@ int config_parse_file(const char *section, struct config_keyset *kset)
>  	int i;
>  	char linebuf[LINE_LEN+1];
>  	char *line = linebuf;
> +	char *end;
>  
>  	pr_debug("%s: section='%s' file='%s'\n", __func__, section, fname);
>  
> @@ -192,7 +193,7 @@ int config_parse_file(const char *section, struct config_keyset *kset)
>  					}
>  					break;
>  				case CONFIG_TYPE_INT:
> -					ce->u.value = atoi(args);
> +					ce->u.value = strtoul(args, &end, 0);


Not that it matters much, but you can also pass a NULL
pointer to strtoul in case you're not interested in the
end (no need to resend of course).


  parent reply	other threads:[~2008-06-06 13:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 13:13 [ULOGD PATCH 0/5] New filter module MARK and misc fixes Eric Leblond
2008-06-06 13:13 ` [ULOGD PATCH 1/5] Fix logic of propagation trough the stack Eric Leblond
2008-06-06 13:13   ` [ULOGD PATCH 2/5] New MARK filtering module Eric Leblond
2008-06-06 13:13     ` [ULOGD PATCH 3/5] Enable reading of hex or dec integer in config file Eric Leblond
2008-06-06 13:13       ` [ULOGD PATCH 4/5] Use ULOGD_IRET_* as return for all interp functions Eric Leblond
2008-06-06 13:13         ` [ULOGD PATCH 5/5] Update configfile for MARK module Eric Leblond
2008-06-12  9:19           ` Pablo Neira Ayuso
2008-06-12  9:19         ` [ULOGD PATCH 4/5] Use ULOGD_IRET_* as return for all interp functions Pablo Neira Ayuso
2008-06-06 13:23       ` Patrick McHardy [this message]
2008-06-12  9:19       ` [ULOGD PATCH 3/5] Enable reading of hex or dec integer in config file Pablo Neira Ayuso
2008-06-06 13:29     ` [ULOGD PATCH 2/5] New MARK filtering module Patrick McHardy
2008-06-06 13:34       ` Eric Leblond
2008-06-08 10:12       ` [ULOGD PATCH] Resent, new " Eric Leblond
2008-06-12  9:18         ` Pablo Neira Ayuso
2008-06-12  9:18   ` [ULOGD PATCH 1/5] Fix logic of propagation trough the stack Pablo Neira Ayuso

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=48493A5E.2060109@trash.net \
    --to=kaber@trash.net \
    --cc=eric@inl.fr \
    --cc=netfilter-devel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox