Fixed crash when receiving bad tics

This commit is contained in:
Michiel Broek 2005-11-19 12:30:32 +00:00
parent 545fcae26d
commit ef3ea01f51
3 changed files with 12 additions and 3 deletions

View File

@ -2,6 +2,9 @@ $Id$
v0.83.2 16-Nov-2005
mbfido:
Fixed crash when receiving bad tics.
v0.83.1 12-Nov-2005 - 16-Nov-2005

View File

@ -52,6 +52,7 @@ void fill_orphans(orphans **qal, char *TicName, char *Area, char *FileName, int
orphans *tmp;
tmp = (orphans *)malloc(sizeof(orphans));
tmp->next = *qal;
snprintf(tmp->TicName, 13, TicName);
snprintf(tmp->Area, 21, Area);
snprintf(tmp->FileName, 81, FileName);

View File

@ -64,7 +64,7 @@ int Tic()
DIR *dp;
struct dirent *de;
struct stat sbuf;
int i, rc = 0;
int i, rc = 0, first = TRUE;
fd_list *fdl = NULL;
orphans *opl = NULL, *tmp;
@ -153,9 +153,14 @@ int Tic()
CreateSema((char *)"mbindex");
Syslog('f', "start tidy_orphans()");
for (tmp = opl; tmp; tmp = opl->next) {
for (tmp = opl; tmp; tmp = tmp->next) {
if (first) {
Syslog('f', "TIC file TIC area Filename ORP CRC");
Syslog('f', "------------ -------------------- ------------ --- ---");
first = FALSE;
}
Syslog('f', "%-12s %-20s %-12s %s %s", tmp->TicName, tmp->Area, tmp->FileName,
tmp->Orphaned ? "ORP" : "n/a", tmp->BadCRC ? "CRC" : "n/a");
tmp->Orphaned ? "Yes" : "No ", tmp->BadCRC ? "Yes" : "No ");
}
tidy_orphans(&opl);