From 634fc3e3e5408bf169df5d4a6261907992bc46c6 Mon Sep 17 00:00:00 2001 From: Alexey Khromov Date: Sun, 5 May 2024 21:47:06 +0300 Subject: [PATCH] Fixed build on 64bit systems (type mismatch in comparison) --- source/bforce/bforce.c | 2 +- source/bfutil/bfindex.c | 7 ++++--- source/bfutil/bfstat.c | 2 +- source/bfutil/nlookup.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/bforce/bforce.c b/source/bforce/bforce.c index 1b1f9f0..bf711b6 100644 --- a/source/bforce/bforce.c +++ b/source/bforce/bforce.c @@ -257,7 +257,7 @@ int main(int argc, char *argv[], char *envp[]) // parsing - while( (ch=getopt(argc, argv, "hfI:p:n:l:a:u:oiC:S:dq")) != EOF ) + while( (ch=getopt(argc, argv, "hfI:p:n:l:a:u:oiC:S:dq")) != (int)-1 ) { switch( ch ) { case 'h': diff --git a/source/bfutil/bfindex.c b/source/bfutil/bfindex.c index 13158bd..2e9e04a 100644 --- a/source/bfutil/bfindex.c +++ b/source/bfutil/bfindex.c @@ -193,7 +193,7 @@ int main(int argc, char *argv[]) (void)setlocale(LC_ALL, ""); /* Set our name (for logging only) */ - while( (c = getopt(argc, argv, "hf")) != EOF ) + while( (c = getopt(argc, argv, "hf")) != (char)-1 ) { switch( c ) { case 'f': @@ -204,8 +204,9 @@ int main(int argc, char *argv[]) exit(0); default: usage(); - exit(1); + exit(5); } + } if( conf_readconf(conf_getconfname(), 0) ) @@ -216,7 +217,7 @@ int main(int argc, char *argv[]) if( log_open(log_getfilename(LOG_FILE_SESSION), NULL, NULL) ) { log("can't continue without logging"); - exit(1); + exit(2); } /* Ignore some terminating signals */ diff --git a/source/bfutil/bfstat.c b/source/bfutil/bfstat.c index 1d96522..095d2f7 100644 --- a/source/bfutil/bfstat.c +++ b/source/bfutil/bfstat.c @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) bfstat_opts_default(&opts); - while( (c = getopt(argc, argv, "acfhn:prst")) != EOF ) + while( (c = getopt(argc, argv, "acfhn:prst")) != (char)-1 ) { switch( c ) { case 'h': diff --git a/source/bfutil/nlookup.c b/source/bfutil/nlookup.c index 556194c..d622d4f 100644 --- a/source/bfutil/nlookup.c +++ b/source/bfutil/nlookup.c @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) /* Initialise current locale */ (void)setlocale(LC_ALL, ""); - while( (ch=getopt(argc, argv, "hrm")) != EOF ) + while( (ch=getopt(argc, argv, "hrm")) != (char)-1 ) { switch( ch ) { case 'h':