X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=cgiedit.c;h=5058dd7c0877ff2855d7e5ff5ec8082ad91dde0f;hb=671eacc5e6173e01ef058d9609231ab9ec0e0847;hp=d4f66c6bab5a42d91934b507f6652ef1af40b032;hpb=d04e7c061314e26891d09a60938b63bd1c7963dc;p=privoxy.git diff --git a/cgiedit.c b/cgiedit.c index d4f66c6b..5058dd7c 100644 --- a/cgiedit.c +++ b/cgiedit.c @@ -1,4 +1,4 @@ -const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.45 2006/12/21 12:57:48 fabiankeil Exp $"; +const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.46 2006/12/27 18:44:52 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $ @@ -42,6 +42,9 @@ const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.45 2006/12/21 12:57:48 fabiankeil * * Revisions : * $Log: cgiedit.c,v $ + * Revision 1.46 2006/12/27 18:44:52 fabiankeil + * Stop shadowing string.h's index(). + * * Revision 1.45 2006/12/21 12:57:48 fabiankeil * Add config option "split-large-forms" * to work around the browser bug reported @@ -995,7 +998,7 @@ jb_err edit_write_file(struct editable_file * file) { /* Must quote '#' characters */ int numhash = 0; - int len; + size_t len; char * src; char * dest; char * str; @@ -1011,7 +1014,7 @@ jb_err edit_write_file(struct editable_file * file) /* Allocate new memory for string */ len = strlen(cur_line->unprocessed); - if (NULL == (str = malloc((size_t) len + 1 + numhash))) + if (NULL == (str = malloc(len + 1 + (size_t)numhash))) { /* Uh oh, just trashed file! */ fclose(fp); @@ -1293,7 +1296,7 @@ static jb_err split_line_on_equals(const char * line, char ** pname, char ** pva name_end--; } - name_len = name_end - line + 1; /* Length excluding \0 */ + name_len = (size_t)(name_end - line) + 1; /* Length excluding \0 */ if (NULL == (*pname = (char *) malloc(name_len + 1))) { return JB_ERR_MEMORY; @@ -1989,7 +1992,7 @@ static jb_err get_file_name_param(struct client_state *csp, char *name; char *fullpath; char ch; - int len; + size_t len; assert(csp); assert(parameters); @@ -2246,7 +2249,7 @@ static jb_err map_radio(struct map * exports, } } - *p = value; + *p = (char)value; return map(exports, buf, 0, "checked", 1); }