-const char parsers_rcs[] = "$Id: parsers.c,v 1.178 2009/06/11 14:13:19 david__schmidt Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.183 2009/06/17 18:23:06 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
#else
timeptr = gmtime(&last_modified);
#endif
- strftime(newheader, sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr);
+ if ((NULL == timeptr) || !strftime(newheader,
+ sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr))
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Randomizing '%s' failed. Crunching the header without replacement.",
+ *header);
+ freez(*header);
+ return JB_ERR_OK;
+ }
+
freez(*header);
*header = strdup("Last-Modified: ");
string_append(header, newheader);
#else
timeptr = gmtime(&tm);
#endif
- if (!strftime(newheader, sizeof(newheader),
- "%a, %d %b %Y %H:%M:%S GMT", timeptr))
+ if ((NULL == timeptr) || !strftime(newheader,
+ sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr))
{
log_error(LOG_LEVEL_ERROR,
- "Randomizing %s failed. Keeping the header unmodified.");
+ "Randomizing '%s' failed. Crunching the header without replacement.",
+ *header);
+ freez(*header);
return JB_ERR_OK;
}