Translate * more precisely.
[privoxy.git] / parsers.c
index 343d4a3..2e12501 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.181 2009/06/17 14:51:23 fabiankeil 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 $
@@ -2334,12 +2334,13 @@ static jb_err server_last_modified(struct client_state *csp, char **header)
 #else
             timeptr = gmtime(&last_modified);
 #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;
             }
 
@@ -3061,12 +3062,13 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header)
 #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;
             }