summaryrefslogtreecommitdiffhomepage
path: root/src/conffile.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-08-04 22:54:59 +0200
committerMichael Adam <obnox@samba.org>2009-08-04 23:47:28 +0200
commitb4d8c5b9bf9a692a7712590e422aa078930212d0 (patch)
treeae8418b4ec24fb5a030e72d6391062a0bc62b745 /src/conffile.c
parent23b09947c6b7d0cf0e05df573fc1658d6d0467c1 (diff)
conffile: change [sg]et_int_arg() to return unsigned long int
This is also the parser regexp for INT in the definition. Michael
Diffstat (limited to 'src/conffile.c')
-rw-r--r--src/conffile.c14
1 files changed, 7 insertions, 7 deletions
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)
{