From b4d8c5b9bf9a692a7712590e422aa078930212d0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 4 Aug 2009 22:54:59 +0200 Subject: conffile: change [sg]et_int_arg() to return unsigned long int This is also the parser regexp for INT in the definition. Michael --- src/conffile.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/conffile.c') diff --git a/src/conffile.c b/src/conffile.c index bba48a6..a3eea02 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -370,17 +370,17 @@ set_bool_arg (unsigned int *var, const char *line, regmatch_t * match) return 0; } -static inline long int +static inline unsigned long int get_int_arg (const char *line, regmatch_t * match) { assert (line); assert (match && match->rm_so != -1); - return strtol (line + match->rm_so, NULL, 0); + return strtoul (line + match->rm_so, NULL, 0); } static int -set_int_arg (int long *var, const char *line, regmatch_t * match) +set_int_arg (unsigned long int *var, const char *line, regmatch_t * match) { assert (var); assert (line); @@ -505,7 +505,7 @@ HANDLE_FUNC (handle_bindsame) static HANDLE_FUNC (handle_port) { - return set_int_arg ((long int *) &conf->port, line, &match[2]); + return set_int_arg ((unsigned long int *) &conf->port, line, &match[2]); } static @@ -546,7 +546,7 @@ HANDLE_FUNC (handle_maxrequestsperchild) static HANDLE_FUNC (handle_timeout) { - return set_int_arg ((long int *) &conf->idletimeout, line, &match[2]); + return set_int_arg ((unsigned long int *) &conf->idletimeout, line, &match[2]); } static @@ -627,7 +627,7 @@ HANDLE_FUNC (handle_errorfile) * present. This is why the "string" is located at * match[4] (rather than the more intuitive match[3]. */ - long int err = get_int_arg (line, &match[2]); + unsigned long int err = get_int_arg (line, &match[2]); char *page = get_string_arg (line, &match[4]); add_new_errorpage (page, err); @@ -774,7 +774,7 @@ HANDLE_FUNC (handle_upstream) ip = get_string_arg (line, &match[2]); if (!ip) return -1; - port = get_int_arg (line, &match[7]); + port = (int)get_int_arg (line, &match[7]); if (match[9].rm_so != -1) { -- cgit v1.2.3