From a039d7a80f93ae61f41a329695189c50002a1c89 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 28 Dec 2006 18:04:25 +0000 Subject: [PATCH] Fixed gcc43 conversion warnings. --- cgiedit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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); } -- 2.39.2