From: Frédéric Marchal Date: Thu, 10 Nov 2011 19:59:17 +0000 (+0000) Subject: Add missing \n on several debug messages X-Git-Tag: v2.3.2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4633554fa061178e21f6b49bf0b25d41ef5edfd;p=thirdparty%2Fsarg.git Add missing \n on several debug messages Some messages were missing the carriage return. The consequence was a concatenation of the following message with the previous one potentially letting it go unnoticed. --- diff --git a/exclude.c b/exclude.c index 80ff91f..486655a 100644 --- a/exclude.c +++ b/exclude.c @@ -211,7 +211,7 @@ void gethexclude(const char *hexfile, int debug) type=extract_address_mask(buf,&name,ipv4,ipv6,&nbits,&next); if (type<0) { - debuga(_("While reading \"%s\""),hexfile); + debuga(_("While reading \"%s\"\n"),hexfile); exit(EXIT_FAILURE); } diff --git a/log.c b/log.c index 8784dc6..aa3a73c 100644 --- a/log.c +++ b/log.c @@ -759,7 +759,7 @@ int main(int argc,char *argv[]) } if(debug) - debuga("Maximum file descriptor: cur=%ld max=%ld, changed to cur="RLIM_STRING" max="RLIM_STRING,l1,l2,rl.rlim_cur,rl.rlim_max); + debuga("Maximum file descriptor: cur=%ld max=%ld, changed to cur="RLIM_STRING" max="RLIM_STRING"\n",l1,l2,rl.rlim_cur,rl.rlim_max); } #endif @@ -879,7 +879,7 @@ int main(int argc,char *argv[]) my_mkdir(ParsedOutputLog); } if (snprintf(arq_log,sizeof(arq_log),"%s/sarg_temp.log",ParsedOutputLog)>=sizeof(arq_log)) { - debuga(_("File name too long: %s/sarg_temp.log"),ParsedOutputLog); + debuga(_("File name too long: %s/sarg_temp.log\n"),ParsedOutputLog); exit(EXIT_FAILURE); } if((fp_log=MY_FOPEN(arq_log,"w"))==NULL) { @@ -1647,7 +1647,7 @@ int main(int argc,char *argv[]) strftime(val2,sizeof(val2),"%d%m%Y",&period.start); strftime(val1,sizeof(val1),"%d%m%Y",&period.end); if (snprintf(val4,sizeof(val4),"%s/sarg-%s_%s-%s_%s.log",ParsedOutputLog,val2,start_hour,val1,end_hour)>=sizeof(val4)) { - debuga(_("File name too long: %s/sarg-%s_%s-%s_%s.log"),ParsedOutputLog,val2,start_hour,val1,end_hour); + debuga(_("File name too long: %s/sarg-%s_%s-%s_%s.log\n"),ParsedOutputLog,val2,start_hour,val1,end_hour); exit(EXIT_FAILURE); } if (rename(arq_log,val4)) { @@ -1661,7 +1661,7 @@ int main(int argc,char *argv[]) necessary around the command name, put them in the configuration file. */ if (snprintf(val1,sizeof(val1),"%s \"%s\"",ParsedOutputLogCompress,arq_log)>=sizeof(val1)) { - debuga(_("Command too long: %s \"%s\""),ParsedOutputLogCompress,arq_log); + debuga(_("Command too long: %s \"%s\"\n"),ParsedOutputLogCompress,arq_log); exit(EXIT_FAILURE); } cstatus=system(val1); diff --git a/smartfilter.c b/smartfilter.c index 4538d70..5ab13da 100644 --- a/smartfilter.c +++ b/smartfilter.c @@ -54,19 +54,19 @@ void smartfilter_report(void) ouser[0]='\0'; if (snprintf(smart_in,sizeof(smart_in),"%s/smartfilter.unsort",outdirname)>=sizeof(smart_in)) { - debuga(_("File name too long: %s/smartfilter.unsort"),outdirname); + debuga(_("File name too long: %s/smartfilter.unsort\n"),outdirname); exit(EXIT_FAILURE); } if (snprintf(sites,sizeof(sites),"%s/sarg-sites",outdirname)>=sizeof(sites)) { - debuga(_("File name too long: %s/sarg-sites"),outdirname); + debuga(_("File name too long: %s/sarg-sites\n"),outdirname); exit(EXIT_FAILURE); } if (snprintf(smart_ou,sizeof(smart_ou),"%s/smartfilter.log",outdirname)>=sizeof(smart_ou)) { - debuga(_("File name too long: %s/smartfilter.log"),outdirname); + debuga(_("File name too long: %s/smartfilter.log\n"),outdirname); exit(EXIT_FAILURE); } if (snprintf(report,sizeof(report),"%s/smartfilter.html",outdirname)>=sizeof(report)) { - debuga(_("File name too long: %s/smartfilter.html"),outdirname); + debuga(_("File name too long: %s/smartfilter.html\n"),outdirname); exit(EXIT_FAILURE); } diff --git a/url.c b/url.c index 188c225..803274c 100644 --- a/url.c +++ b/url.c @@ -122,14 +122,14 @@ static int Alias_StoreName(const char *name,const char *next) NameEnd=++str; while (str' ') { if (*str=='*') { - debuga(_("Host name alias \"%s*%s\" contains too many wildcards (*)"),NameBegin,NameEnd); + debuga(_("Host name alias \"%s*%s\" contains too many wildcards (*)\n"),NameBegin,NameEnd); return(-1); } str++; } NameEndE=str; if (NameEnd==NameEndE) { - debuga(_("Host name alias \"%*s\" must not end with a wildcard"),(int)(next-name),name); + debuga(_("Host name alias \"%*s\" must not end with a wildcard\n"),(int)(next-name),name); return(-1); } } else { @@ -156,7 +156,7 @@ static int Alias_StoreName(const char *name,const char *next) len=(int)(NameBeginE-NameBegin); tmp=malloc(len+1); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } memcpy(tmp,NameBegin,len); @@ -168,7 +168,7 @@ static int Alias_StoreName(const char *name,const char *next) tmp=malloc(len+1); if (!tmp) { if (NameBegin) free((void*)NameBegin); - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } memcpy(tmp,NameEnd,len); @@ -192,7 +192,7 @@ static int Alias_StoreName(const char *name,const char *next) if (!new_alias) { if (NameBegin) free((void*)NameBegin); if (NameEnd) free((void*)NameEnd); - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } new_alias->MinLen=0; @@ -216,7 +216,7 @@ static int Alias_StoreName(const char *name,const char *next) len=(int)(ReplaceE-Replace); tmp=malloc(len+2); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } tmp[0]=ALIAS_PREFIX; @@ -226,7 +226,7 @@ static int Alias_StoreName(const char *name,const char *next) } else { tmp=malloc(new_alias->MinLen+2); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } tmp[0]=ALIAS_PREFIX; @@ -292,7 +292,7 @@ static int Alias_StoreIpv4(unsigned char *ipv4,int nbits,const char *next) // insert into the list new_alias=malloc(sizeof(*new_alias)); if (!new_alias) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } memcpy(new_alias->Ip,ipv4,4); @@ -301,7 +301,7 @@ static int Alias_StoreIpv4(unsigned char *ipv4,int nbits,const char *next) len=(int)(ReplaceE-Replace); tmp=malloc(len+2); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } tmp[0]=ALIAS_PREFIX; @@ -311,7 +311,7 @@ static int Alias_StoreIpv4(unsigned char *ipv4,int nbits,const char *next) } else { tmp=malloc(5*4+1); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } sprintf(tmp,"%c%d.%d.%d.%d/%d",ALIAS_PREFIX,ipv4[0],ipv4[1],ipv4[2],ipv4[3],nbits); @@ -374,7 +374,7 @@ static int Alias_StoreIpv6(unsigned short *ipv6,int nbits,const char *next) // insert into the list new_alias=malloc(sizeof(*new_alias)); if (!new_alias) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } memcpy(new_alias->Ip,ipv6,8*sizeof(unsigned short int)); @@ -383,7 +383,7 @@ static int Alias_StoreIpv6(unsigned short *ipv6,int nbits,const char *next) len=ReplaceE-Replace; tmp=malloc(len+2); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } tmp[0]=ALIAS_PREFIX; @@ -393,7 +393,7 @@ static int Alias_StoreIpv6(unsigned short *ipv6,int nbits,const char *next) } else { tmp=malloc(5*8+5); if (!tmp) { - debuga(_("Not enough memory to store the host name aliasing directives")); + debuga(_("Not enough memory to store the host name aliasing directives\n")); return(-1); } sprintf(tmp,"%c%x:%x:%x:%x:%x:%x:%x:%x/%d",ALIAS_PREFIX,ipv6[0],ipv6[1],ipv6[2],ipv6[3],ipv6[4],ipv6[5],ipv6[6],ipv6[7],nbits); @@ -442,7 +442,7 @@ void read_hostalias(const char *Filename) while ((buf=longline_read(fi,line)) != NULL) { type=extract_address_mask(buf,&name,ipv4,ipv6,&nbits,&next); if (type<0) { - debuga(_("While reading \"%s\""),Filename); + debuga(_("While reading \"%s\"\n"),Filename); exit(EXIT_FAILURE); } diff --git a/usertab.c b/usertab.c index 0cc83c8..63e8dcd 100644 --- a/usertab.c +++ b/usertab.c @@ -70,7 +70,7 @@ static void init_file_usertab(const char *UserTabFile) } nreg = ftell(fp_usr); if (nreg<0) { - debuga(_("Cannot get the size of file %s"),UserTabFile); + debuga(_("Cannot get the size of file %s\n"),UserTabFile); exit(EXIT_FAILURE); } nreg += 100; @@ -79,7 +79,7 @@ static void init_file_usertab(const char *UserTabFile) exit(EXIT_FAILURE); } if((userfile=(char *) malloc(nreg))==NULL){ - debuga(_("ERROR: Cannot load. Memory fault")); + debuga(_("ERROR: Cannot load. Memory fault\n")); exit(EXIT_FAILURE); } userfile[0]='\t';