aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-06-14 20:57:58 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-06-14 20:57:58 +0200
commit64f446220da6f567c818d00a650f92d25391d6e5 (patch)
tree59ebf4f29851e31a192a6287b87690b99c94a417 /src/main.c
parent4d56d7b74f75a918aaa6fa6ab051a3ef9896ffc6 (diff)
downloaddns-64f446220da6f567c818d00a650f92d25391d6e5.tar.gz
fix warnings
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 5 insertions, 13 deletions
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;
}