]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Use boolean to enable some options instead of string compares
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 21 Dec 2009 20:29:39 +0000 (20:29 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 21 Dec 2009 20:29:39 +0000 (20:29 +0000)
43 files changed:
ChangeLog
authfail.c
dansguardian_report.c
datafile.c
denied.c
download.c
getconf.c
grepday.c
html.c
include/conf.h
languages/Bulgarian_windows1251
languages/Catalan
languages/Czech
languages/Czech_UTF8
languages/Dutch
languages/English
languages/French
languages/German
languages/Greek
languages/Hungarian
languages/Indonesian
languages/Italian
languages/Japanese
languages/Latvian
languages/Polish
languages/Polish_windows1250
languages/Portuguese
languages/Romanian
languages/Russian_UTF-8
languages/Russian_koi8
languages/Russian_windows1251
languages/Serbian
languages/Slovak
languages/Spanish
languages/Turkish
languages/Ukrainian_windows1251
log.c
realtime.c
repday.c
report.c
squidguard_report.c
topuser.c
useragent.c

index b16d334d21187afc9a1fc8936a0d7c4af4f7a877..821326196d48ebeb2dd1f7e7efb3f31826f5cbb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,16 @@
 SARG ChangeLog
 
-Dec-18-2009 Version 2.2.7
+Dec-21-2009 Version 2.2.7
                - Extra compile and run time protection (FORTIFY_SOURCE) fixed in configure.
                - Use tabulations as columns separator in intermediary files to avoid problems when a field of the log contains a space.
                - Input log file type detection partly rewritten to clearly distinguish which type is processed where.
                - Read the input log file from standard input if log file name is -.
                - Use string pointers in getword instead of copying the strings over and over.
                - Use LC_TIME to format some dates and times in the report according to the selected locale.
+               - Sarg.conf can list up to 255 access.log files.
+               - Downloaded files suffixes are matched against a sorted list and use a dicchotomic search.
+               - Added getword_atoll to read a number directly from a file without an intermediary string storage.
+               - Use boolean to enable some options instead of string compares.
 
 Dec-17-2009 Version 2.2.6.1
                - Remove unecessary dependency on off_t.
index b27287d6896b6de071c5b9262ffe3277db306f92..3eb07b5f1c3df1ae6d5b8890a5c5392435aae146 100644 (file)
@@ -131,7 +131,7 @@ void authfail_report(void)
             fixip(user);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(ip,sizeof(ip));
 
       if(!z) {
index 07b9161874c388a0d6e63ee969fcdde54459d7f3..35a6506099875a8572155b8d3d1385ad17985e34 100644 (file)
@@ -112,7 +112,7 @@ void dansguardian_report(void)
          exit(1);
       }
 
-      if(strcmp(UserIp,"yes") == 0)
+      if(UserIp)
            strcpy(user,ip);
 
       bzero(date, 15);
@@ -135,7 +135,7 @@ void dansguardian_report(void)
             fixip(user);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(ip,sizeof(ip));
 
       if(!z) {
index 01a3335dd10c75f236e4e25950acf9584e4482b7..e9be8858008a6ccc33406c6ce9267f5f8fe72c7c 100644 (file)
@@ -90,7 +90,7 @@ void data_file(char *tmp)
             exit(1);
          }
 
-         if(strcmp(Ip2Name,"yes") == 0) {
+         if(Ip2Name) {
             if(strcmp(accip,ipantes) != 0) {
                strcpy(ipantes,accip);
                ip2name(accip,sizeof(accip));
index bf831ab678cafcf2c501304667338f545a5232e4..0d6aa3af355e2031bb0472663d5cee51f9d04ee1 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -117,7 +117,7 @@ void gen_denied_report(void)
             fixip(user);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(ip,sizeof(ip));
 
       if(!z) {
index d0a47a95878d3d1e1fe1d9fd7a3933dfea5dc927..fe4894ccc6ded4af71a91972e010d16877b0e974 100644 (file)
@@ -124,7 +124,7 @@ void download_report(void)
             fixip(user);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(ip,sizeof(ip));
 
       if(!z) {
index 8bd916bfd1abfc6eacd808c826b305e53a48127b..b87200959e683dc6f1ce107b20c9c8eb2263049d 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -146,6 +146,30 @@ static int getparam_int(const char *param,char *buf,int *value)
    return(1);
 }
 
+static int getparam_bool(const char *param,char *buf,int *value)
+{
+   int plen;
+   char *str;
+   int i;
+
+   plen=strlen(param);
+   if (strncmp(buf,param,plen) != 0) return(0);
+   buf+=plen;
+   if ((unsigned char)*buf>' ') return(0);
+   while (*buf && (unsigned char)*buf<=' ') buf++;
+
+   *value=0;
+   for (str=text[144] ; *str ; str+=i) {
+      for (i=0 ; str[i] && str[i]!=',' ; i++);
+      if (strncasecmp(str,buf,i)==0) {
+         *value=1;
+         break;
+      }
+      if (str[i]==',') i++;
+   }
+   return(1);
+}
+
 static void parmtest(char *buf)
 {
    char wbuf[50];
@@ -195,9 +219,9 @@ static void parmtest(char *buf)
 
    if (getparam_quoted("title",buf,Title,sizeof(Title))>0) return;
 
-   if (getparam_string("resolve_ip",buf,Ip2Name,sizeof(Ip2Name))>0) return;
+   if (getparam_bool("resolve_ip",buf,&Ip2Name)>0) return;
 
-   if (getparam_string("user_ip",buf,UserIp,sizeof(UserIp))>0) return;
+   if (getparam_bool("user_ip",buf,&UserIp)>0) return;
 
    if (getparam_string("max_elapsed",buf,MaxElapsed,sizeof(MaxElapsed))>0) return;
 
@@ -290,7 +314,7 @@ static void parmtest(char *buf)
 
    if (getparam_2words("topsites_sort_order",buf,TopsitesSortField,sizeof(TopsitesSortField),TopsitesSortType,sizeof(TopsitesSortType))>0) return;
 
-   if (getparam_string("long_url",buf,LongUrl,sizeof(LongUrl))>0) return;
+   if (getparam_bool("long_url",buf,&LongUrl)>0) return;
 
    if (getparam_string("language",buf,language,sizeof(language))>0) return;
 
index 9cd87deae28b9e52fbb36066da9ddab3c05770c5..8246e70337659d538c1eae52c123fb87ac49e1a7 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -424,7 +424,7 @@ void greport_day(const char *user)
    if(strstr(wuser,"_") != 0)
       fixip(wuser);
 
-   if(strcmp(Ip2Name,"yes") == 0)
+   if(Ip2Name)
       if((str=(char *) strstr(name, ".")) != (char *) NULL) {
          if((str=(char *) strstr(str+1, ".")) != (char *) NULL)
             ip2name(wuser,sizeof(wuser));
diff --git a/html.c b/html.c
index 56628f6ff6e96c7b4d9d381eb52835d73ac32559..cb8388337fb08b19b128015737186f6c5e1cc548 100644 (file)
--- a/html.c
+++ b/html.c
@@ -170,7 +170,7 @@ void htmlrel(void)
       strcpy(u2,usuario);
       if(userip)
          fixip(u2);
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(u2,sizeof(u2));
 
       get_usertab_name(u2,name2,sizeof(name2));
@@ -355,7 +355,7 @@ void htmlrel(void)
          strcpy(wwork2,fixnum(nnbytes,1));
          strcpy(wwork3,fixnum2(nnelap,1));
 
-         if(strcmp(LongUrl,"yes") != 0) {
+         if(!LongUrl) {
             char *endofhost=strchr(url,'/');
             if (endofhost) *endofhost='\0';
             strcpy(urly,url);
index d60edee8d9427ebd8b27b2810facd9ba46ec5466..e22ac6ab1ff87131dff21a7cf36bcc4fd1fb232a 100755 (executable)
@@ -184,8 +184,8 @@ char ReportType[255];
 char UserTabFile[255];
 char warea[MAXLEN];
 char name[MAXLEN];
-char LongUrl[20];
-char Ip2Name[20];
+int LongUrl;
+int Ip2Name;
 char language[255];
 char bufy[MAXLEN];
 int NAccessLog;
@@ -221,7 +221,7 @@ char ExcludeUsers[255];
 char DateFormat[2];
 char PerUserLimitFile[255];
 char PerUserLimit[20];
-char UserIp[5];
+int UserIp;
 char MaxElapsed[255];
 char datetimeby[10];
 char csort[255];
index 904225037c1b53ef28cb472121723e50c79e49c6..4df79e4002a6d64d5538c9c83caac95c11bdea2b 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index d20522a84a0450adb5b770669254d8ce5d208818..c1ad1de8b99dc0c0818e7bb1de9f403103ee6a1f 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index dfbda8f90f4cd5ecf70c97f4bddb861abf3ae9ec..f7d659bb1db217fbba1076d947f49cb3f288dc6d 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index b05f09207cf5907e957f3cb7867759f95cfe7afc..ef028ff5c3646704ee4e1f388d6cad962e1622bb 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 85e978a5a1444d026b1c4643467a8d69938cd5f6..0b8a5888609abf7a2c31cd253fac527df343d8dc 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index ed66ad214e4504883e232c65ed4f9c3e74d3961b..d9ae4d03714a68ffe7e9fe3e03f65b1c3917d006 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 88b0abcb751ee819bc1632d49112e8c5620920cd..d3ec084cc1da099c1f161284a2e3f5194adf2a9d 100644 (file)
 "fin du fichier atteinte prématurément pour"
 "analyse du fichier suivant"
 "Log produit par Microsoft ISA"
+"yes,true,on,1,oui,vrai"
index 77ed28d43c8c015ae99a600f49f35fd80761b16b..c0b67e9165547f04d2c06760cb3d43d6d67c1a64 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 143d7ee96c9124c0bd64f0da3f8f92d192c88209..625efb3ff70040c2234acaef0d2df5e045874b65 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 28ee7eccabc365c8d9c0f1785cf753397348952f..652062ca5954e735e765b7a70ded830b2dc9389a 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 32f196819dc1f338f03b5b09a7299ab6bfaf2573..f4990ec310278ae7b12b745d32f0920290fc9944 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 41835059253539d6e6f7fe41c0df3b2e0e3e25bd..743e500a922860763867eb1bd7ae0cfca0db3515 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 690114a795848790b6171ec546c21efa471c649a..320d082383256b158bfc41099b2c55fe2fb61b63 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 769c421eb6bbd2d0e59286f80127a007d0fea2b2..3fca7bd8beffb9c099fe27a054872bd0de80bced 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index f0f1aa19f5fa8a32cbde5f99cc4b3c6cbb10766b..1eb3f83acc941392b7a958fc21c1c947710a4adb 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 87bf355aedee51050ce6d796a0eba3f1322773ff..d140934ef075daa048e0aebc8d17a391ae029104 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index ed5f018e5b5b8a53d705916df5b9d55d9f52479c..676ded1d3b4b9655c1d57ff6951dca7c108d99ca 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 8ff6942c4942ae62beac045661e1188c3b91bc5f..0e9247430d4bb941ba7dfacb771930634a41dcc0 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index f8385632df4d5dd6c33b0c6907872875a4e095f0..f540b4630b733fab2ec2eadeb0dd10accbd2f439 100755 (executable)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index fb33afd9754692bcc118ffca3e99ee5f845f9e43..30ccf037b1a8ba4b3e87306bebe8361d35b3651c 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 9fbadb5766eedb14c95373bbab666a3e7794c2ab..dbf1883176dc5f2f767e79eb8623778dfb09ee0e 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index b9d16bb964c7367e2b4f42223335f5dc148cf9d4..9bb0f68771c71549769c7f27ac805301c0e4c900 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index a2335b27fc3f98be9cdac0b53348f1d84f378e79..d831a3f76fad0fd92878ac53f0b1b7de106014b3 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index 437e153a86f6693aa7d05d501f1acef00ea1bcdf..b02442a0b3f3ecab7e4e9f500253df2083c8988e 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index d3ca5ac06f97f542a8da373110d978308c73d127..0f07619744b97fe2ba27687e24ffbaa3d7892508 100644 (file)
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
index dd1acc43c1bdcd2702a5d6daf7dc1e70c8ca6712..505e85b9fe6268ba073982e41200f470d32ed991 100644 (file)
@@ -142,3 +142,4 @@ DansGuardian"
 "unexpected end of file encountered in"
 "skipping to next file"
 "Log is from Microsoft ISA"
+"yes,true,on,1"
diff --git a/log.c b/log.c
index 033acd83feb454e7460da546f2674c21e692c1cb..545ab6983f3b637c00f3b301546eded1bdc26fe6 100644 (file)
--- a/log.c
+++ b/log.c
@@ -140,14 +140,12 @@ int main(int argc,char *argv[])
    LogoText[0]='\0';
    PasswdFile[0]='\0';
    OutputEmail[0]='\0';
-   Ip2Name[0]='\0';
    UserAgentLog[0]='\0';
    ExcludeHosts[0]='\0';
    ExcludeUsers[0]='\0';
    ConfigFile[0]='\0';
    code[0]='\0';
    LastLog[0]='\0';
-   UserIp[0]='\0';
    ReportType[0]='\0';
    UserTabFile[0]='\0';
    BlockIt[0]='\0';
@@ -171,7 +169,7 @@ int main(int argc,char *argv[])
    strcpy(FontSize,"9px");
    strcpy(TempDir,"/tmp");
    strcpy(OutputDir,"/var/www/html/squid-reports");
-   strcpy(Ip2Name,"no");
+   Ip2Name=0;
    strcpy(DateFormat,"u");
    strcpy(OverwriteReport,"no");
    strcpy(RemoveTempFiles,"yes");
@@ -181,14 +179,14 @@ int main(int argc,char *argv[])
    strcpy(UseComma,"no");
    strcpy(MailUtility,"mailx");
    strcpy(TopSitesNum,"100");
-   strcpy(UserIp,"no");
+   UserIp=0;
    strcpy(TopuserSortField,"BYTES");
    strcpy(UserSortField,"BYTES");
    strcpy(TopuserSortOrder,"reverse");
    strcpy(UserSortOrder,"reverse");
    strcpy(TopsitesSortField,"CONNECT");
    strcpy(TopsitesSortType,"D");
-   strcpy(LongUrl,"no");
+   LongUrl=0;
    strcpy(language,"English");
    strcpy(FontFace,"Verdana,Tahoma,Arial");
    strcpy(datetimeby,"elap");
@@ -507,9 +505,9 @@ int main(int argc,char *argv[])
    if(strcmp(ExcludeUsers,"indexonly") == 0) indexonly++;
    if(strcmp(Index,"only") == 0) indexonly++;
 
-   if(dns) strcpy(Ip2Name,"yes");
+   if(dns) Ip2Name=1;
 
-   if(strcmp(UserIp,"yes") == 0) userip++;
+   if(UserIp) userip++;
 
    if(strlen(MaxElapsed)>1) max_elapsed=atol(MaxElapsed);
 
@@ -586,12 +584,12 @@ int main(int argc,char *argv[])
          fprintf(stderr, "SARG: %35s (-i) = %s\n",text[28],text[2]);
       for (iarq=0 ; iarq<NAccessLog ; iarq++)
          fprintf(stderr, "SARG: %35s (-l) = %s\n",text[37],AccessLog[iarq]);
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          fprintf(stderr, "SARG: %35s (-n) = %s\n",text[65],text[1]);
        else
          fprintf(stderr, "SARG: %35s (-n) = %s\n",text[65],text[2]);
       fprintf(stderr, "SARG: %35s (-o) = %s\n",text[38],outdir);
-      if(strcmp(UserIp,"yes") == 0)
+      if(UserIp)
          fprintf(stderr, "SARG: %35s (-p) = %s\n",text[29],text[1]);
        else
          fprintf(stderr, "SARG: %35s (-p) = %s\n",text[29],text[2]);
@@ -630,12 +628,12 @@ int main(int argc,char *argv[])
          printf("%35s (-i) = %s\n",text[28],text[2]);
       for (iarq=0 ; iarq<NAccessLog ; iarq++)
          printf("%35s (-l) = %s\n",text[37],AccessLog[iarq]);
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          printf("%35s (-n) = %s\n",text[65],text[1]);
        else
          printf("%35s (-n) = %s\n",text[65],text[2]);
       printf("%35s (-o) = %s\n",text[38],outdir);
-      if(strcmp(UserIp,"yes") == 0)
+      if(UserIp)
          printf("%35s (-p) = %s\n",text[29],text[1]);
        else
          printf("%35s (-p) = %s\n",text[29],text[2]);
@@ -1165,7 +1163,7 @@ int main(int argc,char *argv[])
             url[i]='\0';
          }
 
-         if(strcmp(LongUrl,"no") == 0) {
+         if(!LongUrl) {
             char *endofhost=strchr(url,'/');
             if (endofhost)
                *endofhost='\0';
index fce89340f2e52daf3ea56067f15695ee63bfac0c..4ab6b47874a106c0d229f2a01ed9cdee08eeb33a 100755 (executable)
@@ -214,7 +214,7 @@ static void datashow(const char *tmp)
          continue;
 
       strcpy(u2,user);
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(u2,sizeof(u2));
       get_usertab_name(u2,name,sizeof(name));
 
index 4cf2dae46f39f92e67d12e46e17b84c6cf7bf8e0..9ac170f0c88c173e6bdcbdd4cf98ee54d2bcd8f0 100644 (file)
--- a/repday.c
+++ b/repday.c
@@ -92,7 +92,7 @@ void report_day(const char *user)
    if(strstr(wuser,"_") != 0)
       fixip(wuser);
 
-   if(strcmp(Ip2Name,"yes") == 0)
+   if(Ip2Name)
       if((str=(char *) strstr(name, ".")) != (char *) NULL) {
          if((str=(char *) strstr(str+1, ".")) != (char *) NULL)
             ip2name(wuser,sizeof(wuser));
index 79e42dc9bb4aafc85e0d13b3da4c4d1064b439e5..bdf8a3d3117e450732050705f9c0bc88f2d23fe1 100644 (file)
--- a/report.c
+++ b/report.c
@@ -121,7 +121,7 @@ void gerarel(void)
       maketmp_hour(user,tmp,indexonly);
 
       strcpy(u2,user);
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(u2,sizeof(u2));
       get_usertab_name(u2,name,sizeof(name));
 
@@ -154,7 +154,7 @@ void gerarel(void)
             grava_SmartFilter(wdirname,accuser,accip,accdia,acchora,accurl,accsmart);
          }
 
-         if(strcmp(Ip2Name,"yes") == 0) {
+         if(Ip2Name) {
             if(strcmp(accip,ipantes) != 0) {
                strcpy(ipantes,accip);
                ip2name(accip,sizeof(accip));
index 86144ad5642c11bcb37987169acc4f85e2a14e0c..6abd77d2b7e043a1eee208f3b9708a932298f9c2 100644 (file)
@@ -112,7 +112,7 @@ void squidguard_report(void)
          exit(1);
       }
 
-      if(strcmp(UserIp,"yes") == 0)
+      if(UserIp)
            strcpy(user,ip);
 
       bzero(data, 15);
@@ -135,7 +135,7 @@ void squidguard_report(void)
             fixip(user);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(ip,sizeof(ip));
 
       if(!z) {
index bf6478737d81e788bcc32c4c7fad01715f3947df..ed73f527905e0c7e8737cee932ecb373901e15dd 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -450,7 +450,7 @@ void topuser(void)
 
       if(userip) {
          fixip(user2);
-         if(strcmp(Ip2Name,"yes") == 0) {
+         if(Ip2Name) {
             if(strcmp(user2,ipantes) != 0) {
                strcpy(ipantes,user2);
                ip2name(user2,sizeof(user2));
@@ -474,7 +474,7 @@ void topuser(void)
       if(strcmp(user2,"TOTAL") != 0) {
          get_usertab_name(user2,name,sizeof(name));
 
-         if((strcmp(Ip2Name,"yes") == 0) &&
+         if(Ip2Name &&
             ((str=(char *) strstr(name, ".")) != (char *) NULL) &&
             ((str=(char *) strstr(str+1, ".")) != (char *) NULL))
             ip2name(name,sizeof(name));
index 27e20626db23836f2b0b619a54e4804bc4540dc1..8e9d5857627550b452cde97d81ad94e0ab21aeb3 100644 (file)
@@ -175,7 +175,7 @@ void useragent(void)
          exit(1);
       }
 
-      if(strcmp(Ip2Name,"yes") == 0) {
+      if(Ip2Name) {
          if(strcmp(ip,ipbefore) != 0) {
             strcpy(ipbefore,ip);
             ip2name(ip,sizeof(ip));