From: jongfoster <jongfoster@users.sourceforge.net>
Date: Thu, 13 Sep 2001 23:32:40 +0000 (+0000)
Subject: Moving image data to cgi.c rather than cgi.h
X-Git-Tag: v_2_9_9~92
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/static/coding.html?a=commitdiff_plain;h=cf0ec9e8474462c26b7416b417dad9a8fd7be75c;p=privoxy.git

Moving image data to cgi.c rather than cgi.h
Fixing a GPF under Win32 (and any other OS that protects global
constants from being written to).
---

diff --git a/filters.c b/filters.c
index 9a079667..4851dff2 100644
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.27 2001/08/05 16:06:20 jongfoster Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.28 2001/09/10 10:18:51 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -38,6 +38,9 @@ const char filters_rcs[] = "$Id: filters.c,v 1.27 2001/08/05 16:06:20 jongfoster
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.28  2001/09/10 10:18:51  oes
+ *    Silenced compiler warnings
+ *
  *    Revision 1.27  2001/08/05 16:06:20  jongfoster
  *    Modifiying "struct map" so that there are now separate header and
  *    "map_entry" structures.  This means that functions which modify a
@@ -488,15 +491,15 @@ struct http_response *block_url(struct client_state *csp)
       /* and handle accordingly: */
       if ((p == NULL) || (0 == strcmpic(p, "logo")))
       {
-         rsp->body = bindup(JBGIF, sizeof(JBGIF));
-         rsp->content_length = sizeof(JBGIF);
+         rsp->body = bindup(image_junkbuster_gif_data, image_junkbuster_gif_length);
+         rsp->content_length = image_junkbuster_gif_length;
          enlist_unique_header(rsp->headers, "Content-Type", "image/gif");
       }
 
       else if (0 == strcmpic(p, "blank"))
       {
-         rsp->body = bindup(BLANKGIF, sizeof(BLANKGIF));
-         rsp->content_length = sizeof(BLANKGIF);
+         rsp->body = bindup(image_blank_gif_data, image_blank_gif_length);
+         rsp->content_length = image_blank_gif_length;
          enlist_unique_header(rsp->headers, "Content-Type", "image/gif");
       }
 
@@ -1147,12 +1150,10 @@ void apply_url_actions(struct current_action_spec *action,
 const struct forward_spec * forward_url(struct http_request *http,
                                         struct client_state *csp)
 {
-   static const struct forward_spec fwd_default[1];
+   static const struct forward_spec fwd_default[1] = { FORWARD_SPEC_INITIALIZER };
    struct forward_spec *fwd = csp->config->forward;
    struct url_spec url[1];
 
-   memset(&fwd_default, '\0', sizeof(struct forward_spec));
-
    if (fwd == NULL)
    {
       return(fwd_default);