aboutsummaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-11-14 23:42:07 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-11-14 23:42:07 +0000
commitebb95b68792dde490a1ea1042209525f176af58d (patch)
tree2a980be2b7bea3db77dec209e6ca5f591165885b /conf.c
parenta6df0b5d21370549328c7929a008abb68f2ed4db (diff)
parent1bf1ae6f25ff56894d67999791802aa864eaa02b (diff)
Merging from devel/Jelmer.
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/conf.c b/conf.c
index 09fd08e1..551e8f5e 100644
--- a/conf.c
+++ b/conf.c
@@ -46,12 +46,8 @@ conf_t *conf_load( int argc, char *argv[] )
conf = g_new0( conf_t, 1 );
-#ifdef IPV6
- conf->iface = "::";
-#else
- conf->iface = "0.0.0.0";
-#endif
- conf->port = 6667;
+ conf->iface = NULL;
+ conf->port = "6667";
conf->nofork = 0;
conf->verbose = 0;
conf->primary_storage = "xml";
@@ -88,12 +84,8 @@ conf_t *conf_load( int argc, char *argv[] )
}
else if( opt == 'p' )
{
- if( ( sscanf( optarg, "%d", &i ) != 1 ) || ( i <= 0 ) || ( i > 65535 ) )
- {
- fprintf( stderr, "Invalid port number: %s\n", optarg );
- return( NULL );
- }
- conf->port = i;
+ g_free( conf->port );
+ conf->port = g_strdup( optarg );
}
else if( opt == 'P' )
{
@@ -203,12 +195,7 @@ static int conf_loadini( conf_t *conf, char *file )
}
else if( g_strcasecmp( ini->key, "daemonport" ) == 0 )
{
- if( ( sscanf( ini->value, "%d", &i ) != 1 ) || ( i <= 0 ) || ( i > 65535 ) )
- {
- fprintf( stderr, "Invalid port number: %s\n", ini->value );
- return( 0 );
- }
- conf->port = i;
+ conf->port = g_strdup( ini->value );
}
else if( g_strcasecmp( ini->key, "authmode" ) == 0 )
{