From 64f446220da6f567c818d00a650f92d25391d6e5 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 14 Jun 2021 20:57:58 +0200 Subject: fix warnings --- src/main.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 09d4a3f..f6daa43 100644 --- a/src/main.c +++ b/src/main.c @@ -12,10 +12,6 @@ #include "log.h" #include "server.h" -#ifdef _TEST -#include "test.h" -#endif - void print_help( char *_argv0 ) { printf( "dns\n" @@ -29,15 +25,15 @@ void print_help( char *_argv0 ) { } void parse_args( server_config_t *_config, int argc, char* argv[]) { - int i, o; + unsigned int i, o; memset( _config, 0, sizeof( server_config_t ) ); _config->bind_ip = "0.0.0.0"; _config->bind_port = 53; _config->zonefile = "/nofile"; - for( i = 1; i < argc; i++ ) { - const int icpy = i; + for( i = 1; i < (unsigned int)argc; i++ ) { + const unsigned int icpy = i; if ( argv[i][0] != '-' ) { print_help( argv[0] ); exit( 1 ); @@ -52,7 +48,7 @@ void parse_args( server_config_t *_config, int argc, char* argv[]) { _config->bind_ip = argv[++i]; break; case 'p': - _config->bind_port = atoi( argv[++i] ); + _config->bind_port = (uint16_t)atoi( argv[++i] ); break; case 'z': _config->zonefile = argv[++i]; @@ -76,12 +72,8 @@ int main(int argc, char* argv[]) if ( getuid() == 0 ) LOGPRINTF(_LOG_WARNING, "Running as root is not a good idea. Use setcap or unprivileged port instead."); - -#ifdef _TEST - run_test(); -#else server_start( &config ); -#endif + return 0; } -- cgit v1.2.3