// readlog.c
int ReadLogFile(struct ReadLogDataStruct *Filter);
-void GetLogPeriod(struct tm *Start,struct tm *End);
+bool GetLogPeriod(struct tm *Start,struct tm *End);
// realtime.c
void realtime(void);
char date0[30], date1[30];
struct tm Start,End;
- GetLogPeriod(&Start,&End);
- strftime(date0,sizeof(date0),"%x",&Start);
- strftime(date1,sizeof(date1),"%x",&End);
- // TRANSLATORS: The %s are the start and end dates in locale format.
- debuga(__FILE__,__LINE__,_("Period covered by log files: %s-%s\n"),date0,date1);
+ if (GetLogPeriod(&Start,&End)) {
+ strftime(date0,sizeof(date0),"%x",&Start);
+ strftime(date1,sizeof(date1),"%x",&End);
+ // TRANSLATORS: The %s are the start and end dates in locale format.
+ debuga(__FILE__,__LINE__,_("Period covered by log files: %s-%s\n"),date0,date1);
+ }
}
if (!LogStatus){
/*!
* Get the start and end date of the period covered by the log files.
*/
-void GetLogPeriod(struct tm *Start,struct tm *End)
+bool GetLogPeriod(struct tm *Start,struct tm *End)
{
+ bool Valid=false;
+
if (EarliestDate>=0) {
memcpy(Start,&EarliestDateTime,sizeof(struct tm));
+ Valid=true;
} else {
memset(Start,0,sizeof(struct tm));
}
if (LatestDate>=0) {
memcpy(End,&LatestDateTime,sizeof(struct tm));
+ Valid=true;
} else {
memset(End,0,sizeof(struct tm));
}
+ return(Valid);
}