[ULOGD PATCH 3/5] Enable reading of hex or dec integer in config file.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 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);
 					break;
 				case CONFIG_TYPE_CALLBACK:
 					(ce->u.parser)(args);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux