if (!len) return 0;
if (line[len - 1] == '\n')
line[--len] = '\0';
+ if (!len) return 0;
if (line[len - 1] == '\r')
line[--len] = '\0';
for ( ; *line ; line++ ) if (*line == '\t') *line = ' ';
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
- struct tm *ptm = localtime ((time_t *)&f->tstamp);
+ time_t tstamp = f->tstamp;
+ struct tm *ptm = localtime (&tstamp);
fprintf (fp, "%d %s %02d ", ptm->tm_year + 1900, months[ptm->tm_mon],
ptm->tm_mday);