Replace some messages to have less variants of the same message.
Be more consistent in the displayed messages strings. For instance, file
names are displayed between quotes.
fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),authfail_in);
+ debuga(_("Not enough memory to read file \"%s\"\n"),authfail_in);
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the log file %s\n"),arq);
+ debuga(_("Not enough memory to read file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
getword_start(&gwarea,buf);
if (getword_atoi(&year,&gwarea,'.')<0 || getword_atoi(&mon,&gwarea,'.')<0 ||
getword_atoi(&day,&gwarea,' ')<0) {
- debuga(_("Invalid date found in your dansguardian log file %s\n"),loglocation);
+ debuga(_("Invalid date in file \"%s\"\n"),loglocation);
exit(EXIT_FAILURE);
}
if (getword_atoi(&hour,&gwarea,':')<0 || getword(minsec,sizeof(minsec),&gwarea,' ')<0) {
- debuga(_("Invalid time found in your dansguardian log file %s\n"),loglocation);
+ debuga(_("Invalid time found in file \"%s\"\n"),loglocation);
exit(EXIT_FAILURE);
}
if (getword(user,sizeof(user),&gwarea,' ')<0) {
- debuga(_("Invalid user found in your dansguardian log file %s\n"),loglocation);
+ debuga(_("Invalid user found in file \"%s\"\n"),loglocation);
exit(EXIT_FAILURE);
}
if (getword(ip,sizeof(ip),&gwarea,' ')<0) {
- debuga(_("Invalid IP address found in your dansguardian log file %s\n"),loglocation);
+ debuga(_("Invalid IP address in file \"%s\"\n"),loglocation);
exit(EXIT_FAILURE);
}
if (getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) {
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the downloaded files.\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),tmp3);
exit(EXIT_FAILURE);
}
if (fp_ou) fclose(fp_ou);
if(debug)
- debuga(_("Datafile %s written successfully\n"),DataFile);
+ debuga(_("Datafile \"%s\" written successfully\n"),DataFile);
}
void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, char *url, long long int nbytes, char *ip, char *hora, char *dia, long long int nelap, long long int incache, long long int oucache)
int arqlen;
if(access(arq, R_OK) != 0) {
- debuga(_("File not found: %s\n"),arq);
+ debuga(_("File \"%s\" not found\n"),arq);
exit(EXIT_FAILURE);
}
arqlen=strlen(arq);
if(arqlen>3 && strcmp(arq+arqlen-3,".gz") == 0) {
- debuga(_("Decompressing log file \"%s\" with zcat\n"),arq);
+ /* TRANSLATORS: The last %s is the decompression program such as zcat or bzcat */
+ debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"zcat");
if (snprintf(cmd,sizeof(cmd),"zcat \"%s\"",arq)>=sizeof(cmd)) {
- debuga(_("decompression command too long for log file %s\n"),arq);
+ debuga(_("Decompression command too long for log file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
*pipe=true;
}
if(arqlen>4 && strcmp(arq+arqlen-4,".bz2") == 0) {
- debuga(_("Decompressing log file \"%s\" with bzcat\n"),arq);
+ debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"bzcat");
if (snprintf(cmd,sizeof(cmd),"bzcat \"%s\"",arq)>=sizeof(cmd)) {
- debuga(_("decompression command too long for log file %s\n"),arq);
+ debuga(_("Decompression command too long for log file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
*pipe=true;
}
if(arqlen>2 && strcmp(arq+arqlen-2,".Z") == 0) {
- debuga(_("Decompressing log file \"%s\" with zcat\n"),arq);
+ debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"zcat");
if (snprintf(cmd,sizeof(cmd),"zcat \"%s\"",arq)>=sizeof(cmd)) {
- debuga(_("decompression command too long for log file %s\n"),arq);
+ debuga(_("Decompression command too long for log file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
*pipe=true;
fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the denied accesses\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),denied_in);
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
fprintf(fp_ou,"<tr><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th><th class=\"header_l\">%s</th></tr>\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE"));
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the downloaded files\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),report_in);
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
totuser=0;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),wger);
+ debuga(_("Not enough memory to read file \"%s\"\n"),wger);
exit(EXIT_FAILURE);
}
}
if (fseek(fp_ex, 0, SEEK_END)==-1) {
- debuga(_("Failed to move till the end of the excluded users file %s: %s\n"),uexfile,strerror(errno));
+ debuga(_("Failed to move till the end of file \"%s\": %s\n"),uexfile,strerror(errno));
exit(EXIT_FAILURE);
}
nreg = ftell(fp_ex);
if (nreg<0) {
- debuga(_("Cannot get the size of file %s\n"),uexfile);
+ debuga(_("Cannot get the size of file \"%s\": %s\n"),uexfile,strerror(errno));
exit(EXIT_FAILURE);
}
nreg += 11;
}
if((excludeuser=(char *) malloc(nreg))==NULL){
- debuga(_("malloc error (%ld bytes required)\n"),nreg);
+ debuga(_("malloc failed to allocate %ld bytes\n"),nreg);
exit(EXIT_FAILURE);
}
fixendofline(buf);
getword_start(&gwarea,buf);
if (getword_atoll(&llday,&gwarea,'/')<0) {
- debuga(_("Invalid date in file %s\n"),wdirname);
+ debuga(_("Invalid date in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
day=(int)llday;
if (day<1 || day>31) continue;
if (getword_skip(20,&gwarea,'\t')<0 || getword_skip(20,&gwarea,'\t')<0) {
- debuga(_("Invalid entry in file %s\n"),wdirname);
+ debuga(_("Invalid entry in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
if ((datetimeby & DATETIME_BYTE)!=0) {
if (getword_atoll(&bytes,&gwarea,'\t')<0) {
- debuga(_("Invalid number of bytes in file %s\n"),wdirname);
+ debuga(_("Invalid number of bytes in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
bytespoints[day-1]+=bytes;
}
if ((datetimeby & DATETIME_ELAP)!=0) {
if (getword_atoll(&elap,&gwarea,'\0')<0) {
- debuga(_("Invalid elapsed time in file %s\n"),wdirname);
+ debuga(_("Invalid elapsed time in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
elappoints[day-1]+=elap;
fputs("</table>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),wdirname);
+ debuga(_("Write error in file \"%s\"\n"),wdirname);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),wdirname,strerror(errno));
#endif //HAVE_GD
if (access(warea, R_OK) != 0) {
if (mkdir(warea,0755)) {
- debuga(_("Cannot create directory %s - %s\n"),warea,strerror(errno));
+ debuga(_("Cannot create directory \"%s\": %s\n"),warea,strerror(errno));
exit(EXIT_FAILURE);
}
}
have_denied_report=true;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),arqin);
+ debuga(_("Not enough memory to read file \"%s\"\n"),arqin);
exit(EXIT_FAILURE);
}
fputs("</tr></thead>\n",fp_ou);
if(debug) {
- debuga(_("Making report: %s\n"),uinfo->id);
+ debuga(_("Making report %s\n"),uinfo->id);
}
count=0;
arqip[0]='\0';
olduserip[0]='\0';
if ((line1=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),arqip);
+ debuga(_("Not enough memory to read file \"%s\"\n"),arqip);
exit(EXIT_FAILURE);
}
while((buf=longline_read(fp_ip,line1))!=NULL) {
sprintf(olddir,"%s%s",outdir,entry);
if (rename(olddir,newdir)) {
- debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
+ debugapos("index",_("Failed to rename \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
exit(EXIT_FAILURE);
}
else continue;
sprintf(olddir,"%s%04d/%s/%s",outdir,y1,direntp2->d_name,direntp3->d_name);
if(rename(olddir,newdir)) {
- debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
+ debugapos("index",_("Failed to rename \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
exit(EXIT_FAILURE);
}
}
error=getaddrinfo(addr,NULL,NULL,&res);
if (error) {
freeaddrinfo(res);
- debuga(_("Cannot resolve host name %s: %s\n"),name,gai_strerror(error));
+ debuga(_("Cannot resolve host name \"%s\": %s\n"),name,gai_strerror(error));
exit(EXIT_FAILURE);
}
if (res->ai_family==AF_INET) {
if(ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg.conf",SYSCONFDIR);
if(access(ConfigFile, R_OK) != 0) {
- debuga(_("Cannot open config file: %s - %s\n"),ConfigFile,strerror(errno));
+ debuga(_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
exit(EXIT_FAILURE);
}
printf(_(" Debug messages (-x) = %s\n"),(debug) ? _("Yes") : _("No"));
printf(_(" Process messages (-z) = %s\n"),(debugz) ? _("Yes") : _("No"));
printf(_(" Previous reports to keep (--lastlog) = %d\n"),LastLog);
- printf(_("sarg version: %s\n"),VERSION);
+ printf(_("SARG version: %s\n"),VERSION);
}
if(debug)
- debuga(_("sarg version: %s\n"),VERSION);
+ debuga(_("SARG version: %s\n"),VERSION);
#ifdef ENABLE_DOUBLE_CHECK_DATA
debuga(_("Sarg compiled to report warnings if the output is inconsistent\n"));
#warning "No rlimit resource for the number of open files"
#endif
if(rc == -1) {
- debuga(_("setrlimit error - %s\n"),strerror(errno));
+ debuga(_("setrlimit error: %s\n"),strerror(errno));
}
if(debug)
}
}
rewind(fp_in);
- printf(_("SARG: Records in file: %lu, reading: %3.2f%%"),recs1,(float) 0);
+ printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,0.);
putchar('\r');
fflush( stdout ) ;
}
computedate(iyear,imonth,iday,&tt);
if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 ||
tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) {
- debuga(_("Invalid time found in %s\n"),arq);
+ debuga(_("Invalid time found in file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
t=&tt;
computedate(iyear,imonth,iday,&tt);
if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 ||
tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) {
- debuga(_("Invalid time found in %s\n"),arq);
+ debuga(_("Invalid time found in file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
t=&tt;
if (isa_cols[ISACOL_Time]>=0) {
if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 ||
tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) {
- debuga(_("Invalid time found in %s\n"),arq);
+ debuga(_("Invalid time found in file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
}
if (!ufile) {
ufile=malloc(sizeof(*ufile));
if (!ufile) {
- debuga(_("Not enough memory to store the user %s\n"),user);
+ debuga(_("Not enough memory to store user %s\n"),user);
exit(EXIT_FAILURE);
}
memset(ufile,0,sizeof(*ufile));
pclose(fp_in);
else {
fclose(fp_in);
- if( ShowReadStatistics )
- printf(_("SARG: Records in file: %lu, reading: %3.2f%%\n"),recs1, (float) 100 );
+ if( ShowReadStatistics ) {
+ printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,100.);
+ putchar('\n');
+ }
}
}
}
debugaz(_("period=%s\n"),period.text);
}
- if(debug)
- debuga(_("Period: %s\n"),period.text);
+ if(debug) {
+ debuga(_("Period: %s"),period.text);
+ putchar('\n');
+ }
if(fp_denied)
fclose(fp_denied);
}
if (fseek(fp_usr, 0, SEEK_END)==-1) {
- debuga(_("Failed to move till the end of the users file \"%s\": %s\n"),pwdfile,strerror(errno));
+ debuga(_("Failed to move till the end of file \"%s\": %s\n"),pwdfile,strerror(errno));
exit(EXIT_FAILURE);
}
nreg = ftell(fp_usr);
}
if((userfile=(char *) malloc(nreg))==NULL){
- debuga(_("malloc error (%ld)\n"),nreg);
+ debuga(_("malloc failed to allocate %ld bytes\n"),nreg);
exit(EXIT_FAILURE);
}
sprintf(cmd,"tail -%d \"%s\"",realtime_access_log_lines,AccessLog[0]);
fp = popen(cmd, "r");
if (!fp) {
- debuga(_("Failed to get the %d trailing lines of %s: %s\n"),realtime_access_log_lines,AccessLog[0],strerror(errno));
+ debuga(_("Failed to get the %d trailing lines of \"%s\": %s\n"),realtime_access_log_lines,AccessLog[0],strerror(errno));
debuga(_("Failed \"tail\" command: %s\n"),cmd);
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
if (getword(ip,sizeof(ip),&gwarea,'\t')<0) {
- debuga(_("Invalid IP address in file %s\n"),tmp);
+ debuga(_("Invalid IP address in file \"%s\"\n"),tmp);
exit(EXIT_FAILURE);
}
if (getword(user,sizeof(user),&gwarea,'\t')<0) {
- debuga(_("Invalid user name in file %s\n"),tmp);
+ debuga(_("Invalid user found in file \"%s\"\n"),tmp);
exit(EXIT_FAILURE);
}
if (strlen(user) < 1) continue;
}
if(strcmp(leks,"end") != 0) {
if (getword_limit(res,sizeof(res),&gwarea,sep[0])<0) {
- debuga(_("Parsing of tag \"%s\" in redirector log %s returned no result\n"),leks,wentp);
+ debuga(_("Parsing of tag \"%s\" in redirector log \"%s\" returned no result\n"),leks,wentp);
RedirectorErrors++;
return;
}
} else {
if (getword_atoll(&lyear,&gwarea,'-')<0 || getword_atoll(&lmon,&gwarea,'-')<0 ||
getword_atoll(&lday,&gwarea,' ')<0) {
- debuga(_("Invalid date found in file %s\n"),wentp);
+ debuga(_("Invalid date in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
mon=(int)lmon;
day=(int)lday;
if (getword(hour,sizeof(hour),&gwarea,' ')<0) {
- debuga(_("Invalid time found in file %s\n"),wentp);
+ debuga(_("Invalid time found in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
return;
}
if (getword(list,sizeof(list),&gwarea,'/')<0) {
- debuga(_("Invalid redirected list in file %s\n"),wentp);
+ debuga(_("Invalid redirected list in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
if (getword_skip(MAXLEN,&gwarea,' ')<0 || getword_limit(full_url,sizeof(full_url),&gwarea,' ')<0) {
- debuga(_("Invalid URL in file %s\n"),wentp);
+ debuga(_("Invalid URL in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
if (getword(ip,sizeof(ip),&gwarea,'/')<0) {
- debuga(_("Invalid source IP in file %s\n"),wentp);
+ debuga(_("Invalid source IP in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
if (getword_skip(MAXLEN,&gwarea,' ')<0 || getword(user,sizeof(user),&gwarea,' ')<0) {
- debuga(_("Invalid user in file %s\n"),wentp);
+ debuga(_("Invalid user found in file \"%s\"\n"),wentp);
RedirectorErrors++;
return;
}
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the redirector log\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),wentp);
exit(EXIT_FAILURE);
}
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the processed redirector log\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),redirector_sorted);
exit(EXIT_FAILURE);
}
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(user,sizeof(user),&gwarea,'\t')<0) {
- debuga(_("Invalid user in file %s\n"),redirector_sorted);
+ debuga(_("Invalid user found in file \"%s\"\n"),redirector_sorted);
exit(EXIT_FAILURE);
}
if (getword_atoll(&data2,&gwarea,'\t')<0) {
- debuga(_("Invalid date in file %s\n"),redirector_sorted);
+ debuga(_("Invalid date in file \"%s\"\n"),redirector_sorted);
exit(EXIT_FAILURE);
}
if (getword(hora,sizeof(hora),&gwarea,'\t')<0) {
- debuga(_("Invalid time in file %s\n"),redirector_sorted);
+ debuga(_("Invalid time found in file \"%s\"\n"),redirector_sorted);
exit(EXIT_FAILURE);
}
if (getword(ip,sizeof(ip),&gwarea,'\t')<0) {
- debuga(_("Invalid IP address in file %s\n"),redirector_sorted);
+ debuga(_("Invalid IP address in file \"%s\"\n"),redirector_sorted);
exit(EXIT_FAILURE);
}
if (getword_ptr(buf,&url,&gwarea,'\t')<0) {
fputs("</div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
fixendofline(buf);
getword_start(&gwarea,buf);
if (getword(data,sizeof(data),&gwarea,'\t')<0) {
- debuga(_("Invalid date in file %s\n"),wdirname);
+ debuga(_("Invalid date in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
if (sscanf(data,"%d/%d/%d",&day,&month,&year)!=3) continue;
}
if (getword_atoll(&hour,&gwarea,'\t')<0) {
- debuga(_("Invalid time in file %s\n"),wdirname);
+ debuga(_("Invalid time found in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
ihour=(int)hour;
if ((datetimeby & DATETIME_BYTE)!=0) {
colsep=((datetimeby & DATETIME_ELAP)!=0) ? '\t' : '\0';
if (getword_atoll(&bytes,&gwarea,colsep)<0) {
- debuga(_("Invalid number of bytes in file %s\n"),wdirname);
+ debuga(_("Invalid number of bytes in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
tbytes[i]+=bytes;
}
if ((datetimeby & DATETIME_ELAP)!=0) {
if (getword_atoll(&elap,&gwarea,'\0')<0) {
- debuga(_("Invalid elapsed time in file %s\n"),wdirname);
+ debuga(_("Invalid elapsed time in file \"%s\"\n"),wdirname);
exit(EXIT_FAILURE);
}
telap[i]+=elap;
}
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),arqout);
+ debuga(_("Write error in file \"%s\"\n"),arqout);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),arqout,strerror(errno));
return;
}
if(debugz){
- debugaz(_("outdirname=%s\n"),outdirname);
+ debugaz(_("Report output directory name=%s\n"),outdirname);
}
if(UserAgentLog[0] != '\0' && email[0] == '\0') useragent();
oucache=0;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the downloaded files\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),tmp3);
exit(EXIT_FAILURE);
}
if((ReportType & REPORT_TYPE_USERS_SITES) == 0) return(NULL);
if((ReportType & REPORT_TYPE_TOPUSERS) == 0) return(NULL);
- if(debug) debuga(_("Making file: %s/%s\n"),tmp,user);
+ if(debug) debuga(_("Making file %s/%s\n"),tmp,user);
if (snprintf(wdirname,sizeof(wdirname),"%s/%s.utmp",tmp,user)>=sizeof(wdirname)) {
debuga(_("Temporary file name too long: %s/%s.utmp\n"),tmp,user);
exit(EXIT_FAILURE);
to print a long long int unless it is exactly 64-bits long.
*/
if (fprintf(fp_gen,"%s\t%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",uinfo->id,(uint64_t)nacc,(uint64_t)nbytes,url,ip,hora,dia,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache)<0) {
- debuga(_("Failed to write a line in %s\n"),filename);
+ debuga(_("Failed to write a line in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
to print a long long int unless it is exactly 64-bits long.
*/
if (fprintf(fp_gen,"TOTAL\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)globstat.nacc,(uint64_t)globstat.nbytes,(uint64_t)globstat.elap,(uint64_t)globstat.incache,(uint64_t)globstat.oucache)<0) {
- debuga(_("Failed to write the total line in %s\n"),filename);
+ debuga(_("Failed to write the total line in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
}
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid total number of accesses in %s\n"),filename);
+ debuga(_("Invalid total number of accesses in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid total size in %s\n"),filename);
+ debuga(_("Invalid total size in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid total elapsed time in %s\n"),filename);
+ debuga(_("Invalid total elapsed time in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid total cache hit in %s\n"),filename);
+ debuga(_("Invalid total cache hit in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\0') {
- debuga(_("Invalid total cache miss in %s\n"),filename);
+ debuga(_("Invalid total cache miss in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
item->oucache=number*sign;
item->user=buffer;
for (i=0 ; i<MAX_USER_LEN-1 && (unsigned char)*buffer>=' ' ; i++) buffer++;
if (*buffer!='\t') {
- debuga(_("User name too long or invalid in %s\n"),filename);
+ debuga(_("User name too long or invalid in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
*buffer++='\0';
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid number of accesses in %s\n"),filename);
+ debuga(_("Invalid number of accesses in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid number of bytes in %s\n"),filename);
+ debuga(_("Invalid number of bytes in file \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
item->url=buffer;
while ((unsigned char)*buffer>=' ') buffer++;
if (*buffer!='\t') {
- debuga(_("URL too long or invalid in %s\n"),filename);
+ debuga(_("URL too long or invalid in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
*buffer++='\0';
item->ip=buffer;
for (i=0 ; i<MAX_IP_LEN-1 && (unsigned char)*buffer>=' ' ; i++) buffer++;
if (*buffer!='\t') {
- debuga(_("IP address too long or invalid in %s\n"),filename);
+ debuga(_("IP address too long or invalid in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
*buffer++='\0';
item->time=buffer;
for (i=0 ; i<MAX_DATETIME_LEN-1 && (unsigned char)*buffer>=' ' ; i++) buffer++;
if (*buffer!='\t') {
- debuga(_("Time too long or invalid in %s\n"),filename);
+ debuga(_("Time too long or invalid in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
*buffer++='\0';
item->date=buffer;
for (i=0 ; i<MAX_DATETIME_LEN-1 && (unsigned char)*buffer>=' ' ; i++) buffer++;
if (*buffer!='\t') {
- debuga(_("Date too long or invalid in %s\n"),filename);
+ debuga(_("Date too long or invalid in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
*buffer++='\0';
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid elapsed time in %s\n"),filename);
+ debuga(_("Invalid elapsed time in file \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\t') {
- debuga(_("Invalid cache hit size in %s\n"),filename);
+ debuga(_("Invalid cache hit size in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
buffer++;
while (isdigit(*buffer))
number=(number * 10) + (*buffer++)-'0';
if (*buffer!='\0') {
- debuga(_("Invalid cache miss size in %s\n"),filename);
+ debuga(_("Invalid cache miss size in \"%s\"\n"),filename);
exit(EXIT_FAILURE);
}
item->oucache=number*sign;
char wdirname[MAXLEN];
if (snprintf(wdirname,sizeof(wdirname),"%s/smartfilter.int_unsort",dirname)>=sizeof(wdirname)) {
- debuga(_("File name too long for %s/smartfilter.int_unsort\n"),dirname);
+ debuga(_("File name too long: %s/smartfilter.int_unsort\n"),dirname);
exit(EXIT_FAILURE);
}
topuser_link=((ReportType & REPORT_TYPE_USERS_SITES) != 0 && !indexonly);
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),general2);
+ debuga(_("Not enough memory to read file \"%s\"\n"),general2);
exit(EXIT_FAILURE);
}
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the log file %s\n"),arq);
+ debuga(_("Not enough memory to read file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
time(&min_tt);
while((buf=longline_read(fp_in,line))!=NULL) {
getword_start(&gwarea,buf);
if (getword(data,sizeof(data),&gwarea,' ')<0) {
- debuga(_("Invalid date found in file %s\n"),arq);
+ debuga(_("Invalid date in file \"%s\"\n"),arq);
exit(EXIT_FAILURE);
}
tt=atoi(data);
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),general2);
+ debuga(_("Not enough memory to read file \"%s\"\n"),general2);
exit(EXIT_FAILURE);
}
ntopsites = 0;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read file %s\n"),sites);
+ debuga(_("Not enough memory to read file \"%s\"\n"),sites);
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ou);
if (write_html_trailer(fp_ou)<0)
- debuga(_("Write error in file %s\n"),report);
+ debuga(_("Write error in file \"%s\"\n"),report);
if (fclose(fp_ou)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
totuser=0;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the file %s\n"),wger);
+ debuga(_("Not enough memory to read file \"%s\"\n"),wger);
exit(EXIT_FAILURE);
}
ntopuser = 0;
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the downloaded files\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),top1);
exit(EXIT_FAILURE);
}
if (debug) debuga(_("Reading host alias file \"%s\"\n"),Filename);
fi=fopen(Filename,"rt");
if (!fi) {
- debuga(_("Cannot read host name alias file \"%s\" - %s\n"),Filename,strerror(errno));
+ debuga(_("Cannot read host name alias file \"%s\": %s\n"),Filename,strerror(errno));
exit(EXIT_FAILURE);
}
if ((line=longline_create())==NULL) {
- debuga(_("Not enough memory to read the host name aliases\n"));
+ debuga(_("Not enough memory to read file \"%s\"\n"),Filename);
exit(EXIT_FAILURE);
}
fputs("</table></div>\n",fp_ht);
if (write_html_trailer(fp_ht)<0)
- debuga(_("Write error in file %s\n"),hfile);
+ debuga(_("Write error in file \"%s\"\n"),hfile);
if (fclose(fp_ht)==EOF)
debuga(_("Failed to close file \"%s\": %s\n"),hfile,strerror(errno));
exit(EXIT_FAILURE);
}
if (fseek(fp_usr, 0, SEEK_END)==-1) {
- debuga(_("Failed to move till the end of the usertab file %s: %s\n"),UserTabFile,strerror(errno));
+ debuga(_("Failed to move till the end of file \"%s\": %s\n"),UserTabFile,strerror(errno));
exit(EXIT_FAILURE);
}
nreg = ftell(fp_usr);
chars=0;
for (i=0 ; name[i] ; i++) {
if (i>=sizeof(w0)) {
- debuga(_("directory name too long: %s\n"),name);
+ debuga(_("Directory name too long: %s\n"),name);
exit(EXIT_FAILURE);
}
if (chars>0 && name[i] == '/') {
}
if ((line=longline_create())==NULL) {
- /* TRANSLATORS: %s is a file name.
- */
- debuga(_("Not enough memory to read \"%s\"\n"),wdir);
+ debuga(_("Not enough memory to read file \"%s\"\n"),wdir);
exit(EXIT_FAILURE);
}
sprintf(wdir,"%s/sarg-date",outdirname);
if ((fp_ou = fopen(wdir, "wt")) == 0) {
- debuga(_("Cannot open \"%s\": %s\n"),wdir,strerror(errno));
+ debuga(_("Cannot open file \"%s\": %s\n"),wdir,strerror(errno));
perror("SARG:");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
if (fclose(fp_ou)==EOF) {
- debuga(_("Failed to write the date in \"%s\": %s\n"),wdir,strerror(errno));
+ debuga(_("Failed to close file \"%s\": %s\n"),wdir,strerror(errno));
perror("SARG:");
exit(EXIT_FAILURE);
}
}
if (fseek(fp_in, 0, SEEK_END)==-1) {
- debuga(_("Failed to move till the end of the excluded codes file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
+ debuga(_("Failed to move till the end of file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
exit(EXIT_FAILURE);
}
MemSize = ftell(fp_in);
void version(void)
{
- printf(_("SARG Version: %s\n"),VERSION);
+ printf(_("SARG version: %s\n"),VERSION);
#if defined(ENABLE_NLS) && defined(HAVE_LOCALE_H)
if (debug) {
printf(_("\nFor the translation to work, a valid message file should be installed as "