about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c226
-rw-r--r--src/HTInit.c8
-rw-r--r--src/HTML.c20
-rw-r--r--src/LYCgi.c7
-rw-r--r--src/LYCookie.c25
-rw-r--r--src/LYCurses.c6
-rw-r--r--src/LYGlobalDefs.h3
-rw-r--r--src/LYLocal.c8
-rw-r--r--src/LYMain.c3
-rw-r--r--src/LYMainLoop.c3
-rw-r--r--src/LYReadCFG.c3
-rw-r--r--src/LYStrings.c5
-rw-r--r--src/LYrcFile.h3
-rw-r--r--src/UCdomap.c4
-rw-r--r--src/chrtrans/makeuctb.c10
15 files changed, 182 insertions, 152 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 5ed8e440..b4c14c39 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: GridText.c,v 1.186 2010/05/05 09:19:31 tom Exp $
+ * $LynxId: GridText.c,v 1.188 2010/06/17 10:50:36 tom Exp $
  *
  *		Character grid hypertext object
  *		===============================
@@ -201,7 +201,7 @@ enum {
 typedef struct _HTPool {
     pool_data data[POOL_SIZE];
     struct _HTPool *prev;
-    int used;
+    unsigned used;
 } HTPool;
 
 /************************************************************************
@@ -747,7 +747,7 @@ static int StyleToCols(HText *text, HTLine *line, int nstyle)
 	if (IsSpecialAttrChar(*data) && *data != LY_SOFT_NEWLINE) {
 	    ++data;
 	} else {
-	    utf_extra = utf8_length(text->T.output_utf8, data);
+	    utf_extra = (int) utf8_length(text->T.output_utf8, data);
 	    if (utf_extra++) {
 		result += LYstrExtent(data, utf_extra, 2);
 		data += utf_extra;
@@ -785,7 +785,7 @@ static void LYClearHiText(TextAnchor *a)
  */
 static void LYSetHiText(TextAnchor *a,
 			const char *text,
-			int len)
+			unsigned len)
 {
     if (text != NULL) {
 	POOLallocstring(a->lites.hl_base.hl_text, len + 1);
@@ -804,8 +804,8 @@ static void LYAddHiText(TextAnchor *a,
 			int x)
 {
     HiliteInfo *have = a->lites.hl_info;
-    unsigned need = (a->lites.hl_len - 1);
-    unsigned want = (a->lites.hl_len += 1) * sizeof(HiliteInfo);
+    unsigned need = (unsigned) (a->lites.hl_len - 1);
+    unsigned want = (unsigned) (a->lites.hl_len += 1) * sizeof(HiliteInfo);
 
     if (have != NULL) {
 	have = (HiliteInfo *) realloc(have, want);
@@ -816,7 +816,7 @@ static void LYAddHiText(TextAnchor *a,
 
     POOLallocstring(have[need].hl_text, strlen(text) + 1);
     strcpy(have[need].hl_text, text);
-    have[need].hl_x = x;
+    have[need].hl_x = (short) x;
 }
 
 /*
@@ -1096,10 +1096,10 @@ HText *HText_new(HTParentAnchor *anchor)
     self->historical_comments = historical_comments;
     self->minimal_comments = minimal_comments;
     self->soft_dquotes = soft_dquotes;
-    self->old_dtd = Old_DTD;
-    self->keypad_mode = keypad_mode;
-    self->disp_lines = LYlines;
-    self->disp_cols = DISPLAY_COLS;
+    self->old_dtd = (short) Old_DTD;
+    self->keypad_mode = (short) keypad_mode;
+    self->disp_lines = (short) LYlines;
+    self->disp_cols = (short) DISPLAY_COLS;
 #endif
     /*
      * If we are going to render the List Page, always merge in hidden
@@ -1791,7 +1791,7 @@ static void display_title(HText *text)
     }
     LYmove(0, i);
 #else
-    i = (limit - 1) - strlen(percent) - strlen(title);
+    i = (limit - 1) - (int) (strlen(percent) + strlen(title));
     if (i >= CHAR_WIDTH) {
 	LYmove(0, i);
     } else {
@@ -2167,10 +2167,10 @@ static void display_page(HText *text,
 					     NULL,
 					     &LenNeeded)) != NULL &&
 		   ((int) line->offset + LenNeeded) <= DISPLAY_COLS) {
-		int itmp = 0;
-		int written = 0;
+		size_t itmp = 0;
+		size_t written = 0;
 		int x_pos = offset + (int) (cp - data);
-		int len = strlen(target);
+		size_t len = strlen(target);
 		size_t utf_extra = 0;
 		int y;
 
@@ -2565,9 +2565,9 @@ static int set_style_by_embedded_chars(char *s,
     int ret = NO;
 
     while (--e >= s) {
-	if (*e == end_c)
+	if (UCH(*e) == end_c)
 	    break;
-	if (*e == start_c) {
+	if (UCH(*e) == start_c) {
 	    ret = YES;
 	    break;
 	}
@@ -2622,13 +2622,13 @@ static void move_anchors_in_region(HTLine *line, int line_number,
 	/* Fix the start */
 	if (!head_processed && a->line_num == line_number
 	    && a->line_pos >= sbyte) {
-	    a->line_pos += shift;
-	    a->extent -= shift;
+	    a->line_pos = (short) (a->line_pos + shift);
+	    a->extent = (short) (a->extent - shift);
 	    head_processed = 1;
 	}
 	/* Fix the end */
 	if (last < ebyte) {
-	    a->extent += shift;
+	    a->extent = (short) (a->extent + shift);
 	} else {
 	    break;		/* Keep this `a' for the next step */
 	}
@@ -2685,7 +2685,7 @@ static HTLine *insert_blanks_in_line(HTLine *line, int line_number,
 	else
 	    mod_line = TEMP_LINE(text, 0);
     } else {
-	allocHTLine(mod_line, line->size + added_chars);
+	allocHTLine(mod_line, (unsigned) (line->size + added_chars));
     }
     if (!mod_line)
 	return NULL;
@@ -2752,10 +2752,13 @@ static HTLine *insert_blanks_in_line(HTLine *line, int line_number,
     while (pre < s)		/* Copy remaining style-codes */
 	*t++ = *pre++;
     /* Check whether the last anchor continues on the next line */
-    if (head_processed && *prev_anchor && (*prev_anchor)->line_num == line_number)
-	(*prev_anchor)->extent += shift;
+    if (head_processed
+	&& *prev_anchor
+	&& (*prev_anchor)->line_num == line_number) {
+	(*prev_anchor)->extent = (short) ((*prev_anchor)->extent + shift);
+    }
     *t = '\0';
-    mod_line->size = t - newdata;
+    mod_line->size = (unsigned short) (t - newdata);
     return mod_line;
 }
 
@@ -2881,7 +2884,7 @@ static void split_line(HText *text, unsigned split)
 	    split = previous->size;
 	    if ((cp = strrchr(previous->data, ' ')) &&
 		cp - previous->data > 1)
-		split = cp - previous->data;
+		split = (unsigned) (cp - previous->data);
 	    CTRACE((tfp, "                split adjusted to %u.\n", split));
 	}
     }
@@ -2935,7 +2938,7 @@ static void split_line(HText *text, unsigned split)
 
 	/* Split the line. -FM */
 	prevdata[previous->size] = '\0';
-	previous->size = split;
+	previous->size = (unsigned short) split;
 
 	/*
 	 * Trim any spaces or soft hyphens from the beginning
@@ -2963,7 +2966,7 @@ static void split_line(HText *text, unsigned split)
 
 	plen = strlen(p);
 	if (plen) {		/* Count funny characters */
-	    for (i = (plen - 1); i >= 0; i--) {
+	    for (i = (int) (plen - 1); i >= 0; i--) {
 		if (p[i] == LY_UNDERLINE_START_CHAR ||
 		    p[i] == LY_UNDERLINE_END_CHAR ||
 		    p[i] == LY_BOLD_START_CHAR ||
@@ -2975,13 +2978,13 @@ static void split_line(HText *text, unsigned split)
 		}
 		if (p[i] == LY_SOFT_HYPHEN &&
 		    (int) text->permissible_split < i)
-		    text->permissible_split = i + 1;
+		    text->permissible_split = (unsigned) (i + 1);
 	    }
 	    ctrl_chars_on_this_line += utfxtra_on_this_line;
 
 	    /* Add the data to the new line. -FM */
 	    strcat(linedata, p);
-	    line->size += plen;
+	    line->size = (unsigned short) (line->size + plen);
 	}
     }
 
@@ -3012,7 +3015,7 @@ static void split_line(HText *text, unsigned split)
 	p--;			/*  Strip trailers. */
     }
     TailTrim = previous->data + previous->size - 1 - p;		/*  Strip trailers. */
-    previous->size -= TailTrim;
+    previous->size = (unsigned short) (previous->size - TailTrim);
     p[1] = '\0';
 
     /*
@@ -3023,7 +3026,7 @@ static void split_line(HText *text, unsigned split)
     if (split == 0) {
 	s = previous->size + TailTrim;	/* the original size */
     } else {
-	s = split;
+	s = (int) split;
     }
     s_post = s + HeadTrim;
     s_pre = s - TailTrim;
@@ -3083,7 +3086,7 @@ static void split_line(HText *text, unsigned split)
 	     */
 	    if (scan->sc_direction == STACK_OFF) {
 		scan = skip_matched_and_correct_offsets(scan, previous->styles,
-							s_pre);
+							(unsigned) s_pre);
 		if (!scan) {
 		    CTRACE((tfp, "BUG: styles improperly nested.\n"));
 		    break;
@@ -3136,7 +3139,7 @@ static void split_line(HText *text, unsigned split)
 	} else if (line->numstyles == 0) {
 	    line->styles[0].sc_horizpos = ~0;	/* ?!!! */
 	}
-	previous->numstyles = at_end - previous->styles + 1;
+	previous->numstyles = (unsigned short) (at_end - previous->styles + 1);
 	if (previous->numstyles == 0) {
 	    previous->styles[0].sc_horizpos = ~0;	/* ?!!! */
 	}
@@ -3269,7 +3272,7 @@ static void split_line(HText *text, unsigned split)
 	new_offset += indent;
 	break;
     }				/* switch */
-    previous->offset = ((new_offset < 0) ? 0 : new_offset);
+    previous->offset = (unsigned short) ((new_offset < 0) ? 0 : new_offset);
 
     if (text->stbl)
 	/*
@@ -3330,10 +3333,12 @@ static void split_line(HText *text, unsigned split)
 		    CTRACE_SPLITLINE((tfp, "anchor %d: no relocation", n));
 		    if (end > s_post) {
 			CTRACE_SPLITLINE((tfp, " of the start.\n"));
-			a->extent += -(TailTrim + HeadTrim) + SpecialAttrChars;
+			a->extent = (short) (a->extent
+					     - (TailTrim + HeadTrim)
+					     + SpecialAttrChars);
 		    } else {
 			CTRACE_SPLITLINE((tfp, ", cut the end.\n"));
-			a->extent = s_pre - start;
+			a->extent = (short) (s_pre - start);
 		    }
 		    continue;
 		} else if (start < s && !len
@@ -3341,7 +3346,7 @@ static void split_line(HText *text, unsigned split)
 		    CTRACE_SPLITLINE((tfp,
 				      "anchor %d: no relocation, empty-finished",
 				      n));
-		    a->line_pos = s_pre;	/* Leave at the end of line */
+		    a->line_pos = (short) s_pre;	/* Leave at the end of line */
 		    continue;
 		}
 
@@ -3361,8 +3366,8 @@ static void split_line(HText *text, unsigned split)
 		    len -= s_post - start;
 		    start = s_post;
 		}
-		a->line_pos = start - s_post + SpecialAttrChars;
-		a->extent = len;
+		a->line_pos = (short) (start - s_post + SpecialAttrChars);
+		a->extent = (short) len;
 
 		CTRACE_SPLITLINE((tfp, "->(%d,%d,%d)\n",
 				  a->line_num, a->line_pos, a->extent));
@@ -3410,7 +3415,7 @@ static void split_line(HText *text, unsigned split)
 		continue;
 	    }
 	    if (text->T.output_utf8 && is8bits(c)) {
-		int utf_extra = utf8_length(text->T.output_utf8, jp);
+		int utf_extra = (int) utf8_length(text->T.output_utf8, jp);
 
 		r->byte_len += utf_extra;
 		jp += utf_extra;
@@ -3419,7 +3424,8 @@ static void split_line(HText *text, unsigned split)
 	++ht_num_runs;
 
 	if (ht_num_runs != 1) {
-	    int *oldpos = (int *) malloc(sizeof(int) * 2 * (ht_num_runs - 1));
+	    int *oldpos = (int *) malloc(sizeof(int)
+					 * 2 * (size_t) (ht_num_runs - 1));
 	    int *newpos = oldpos + ht_num_runs - 1;
 	    int i = 1;
 
@@ -4043,7 +4049,9 @@ void HText_appendCharacter(HText *text, int ch)
 		    return;
 		}
 
-		for (i = (text->permissible_split + 1); line->data[i]; i++) {
+		for (i = (int) (text->permissible_split + 1);
+		     line->data[i];
+		     i++) {
 		    if (!IsSpecialAttrChar(UCH(line->data[i])) &&
 			!isspace(UCH(line->data[i])) &&
 			UCH(line->data[i]) != '-' &&
@@ -4241,7 +4249,7 @@ void HText_appendCharacter(HText *text, int ch)
 	    if (target_cu > WRAP_COLS(text))
 		target -= target_cu - WRAP_COLS(text);
 	    if (line->size == 0) {
-		line->offset += (target - here);
+		line->offset = (unsigned short) (line->offset + (target - here));
 	    } else {
 		for (; here < target; here++) {
 		    /* Put character into line */
@@ -4611,7 +4619,7 @@ static int HText_insertBlanksInStblLines(HText *me, int ncols)
     /*
      * oldpos, newpos:  allocate space for two int arrays.
      */
-    oldpos = typecallocn(int, 2 * ncols);
+    oldpos = typecallocn(int, 2 * (size_t) ncols);
     if (!oldpos)
 	return -1;
     else
@@ -4806,9 +4814,9 @@ static int HText_insertBlanksInStblLines(HText *me, int ncols)
 	    }
 #endif
 	    CTRACE((tfp, " %d:%d", lineno, table_offset - line->offset));
-	    line->offset = (table_offset > 0
-			    ? table_offset
-			    : 0);
+	    line->offset = (unsigned short) (table_offset > 0
+					     ? table_offset
+					     : 0);
 	}
     }
 #ifdef EXP_NESTED_TABLES
@@ -5084,7 +5092,7 @@ static void add_link_number(HText *text, TextAnchor *a, BOOL save_position)
 	    text->LastChar = ']';	/* if marker not after space caused split */
 	if (save_position) {
 	    a->line_num = text->Lines;
-	    a->line_pos = text->last_line->size;
+	    a->line_pos = (short) text->last_line->size;
 	}
     }
 }
@@ -5107,7 +5115,7 @@ int HText_beginAnchor(HText *text, BOOL underline,
 
     a->sgml_offset = SGML_offset();
     a->line_num = text->Lines;
-    a->line_pos = text->last_line->size;
+    a->line_pos = (short) text->last_line->size;
     if (text->last_anchor) {
 	text->last_anchor->next = a;
     } else {
@@ -5230,7 +5238,7 @@ static BOOL HText_endAnchor0(HText *text, int number,
 	 * white and special characters, starting
 	 * with the content on the last line.  -FM
 	 */
-	a->extent += extent_adjust;
+	a->extent = (short) (a->extent + extent_adjust);
 	if (a->extent > (int) last->size) {
 	    /*
 	     * The anchor extends over more than one line,
@@ -5339,7 +5347,7 @@ static BOOL HText_endAnchor0(HText *text, int number,
 	    }
 	}
 	if (!really) {		/* Just report whether it is empty */
-	    a->extent -= extent_adjust;
+	    a->extent = (short) (a->extent - extent_adjust);
 	    return (BOOL) (i == 0);
 	}
 	if (i == 0) {
@@ -5420,9 +5428,9 @@ static BOOL HText_endAnchor0(HText *text, int number,
 			NumSize++;
 			if (start == last && (int) text->permissible_split > j) {
 			    if ((int) text->permissible_split - NumSize < j)
-				text->permissible_split = j;
+				text->permissible_split = (unsigned) j;
 			    else
-				text->permissible_split -= NumSize;
+				text->permissible_split -= (unsigned) NumSize;
 			}
 			k = j + NumSize;
 			while (k < (int) start->size)
@@ -5430,10 +5438,10 @@ static BOOL HText_endAnchor0(HText *text, int number,
 			for (anc = a; anc; anc = anc->next) {
 			    if (anc->line_num == a->line_num &&
 				anc->line_pos >= NumSize) {
-				anc->line_pos -= NumSize;
+				anc->line_pos = (short) (anc->line_pos - NumSize);
 			    }
 			}
-			start->size = j;
+			start->size = (unsigned short) j;
 			start->data[j++] = '\0';
 			while (j < k)
 			    start->data[j++] = '\0';
@@ -5460,7 +5468,7 @@ static BOOL HText_endAnchor0(HText *text, int number,
 			     */
 			    while (i < (int) prev->size)
 				prev->data[j++] = prev->data[i++];
-			    prev->size = j;
+			    prev->size = (unsigned short) j;
 			    prev->data[j] = '\0';
 			    while (j < i)
 				prev->data[j++] = '\0';
@@ -5468,7 +5476,7 @@ static BOOL HText_endAnchor0(HText *text, int number,
 				if ((int) text->permissible_split < k)
 				    text->permissible_split = 0;
 				else
-				    text->permissible_split -= k;
+				    text->permissible_split -= (unsigned) k;
 			    }
 			    j = 0;
 			    i = k;
@@ -5477,10 +5485,10 @@ static BOOL HText_endAnchor0(HText *text, int number,
 			    for (anc = a; anc; anc = anc->next) {
 				if (anc->line_num == a->line_num &&
 				    anc->line_pos >= i) {
-				    anc->line_pos -= i;
+				    anc->line_pos = (short) (anc->line_pos - i);
 				}
 			    }
-			    start->size = j;
+			    start->size = (unsigned short) j;
 			    start->data[j++] = '\0';
 			    while (j < k)
 				start->data[j++] = '\0';
@@ -5528,7 +5536,7 @@ static BOOL HText_endAnchor0(HText *text, int number,
 			    k = j + NumSize;
 			    while (k < (int) prev->size)
 				prev->data[j++] = prev->data[k++];
-			    prev->size = j;
+			    prev->size = (unsigned short) j;
 			    prev->data[j++] = '\0';
 			    while (j < k)
 				prev->data[j++] = '\0';
@@ -5591,8 +5599,9 @@ static BOOL HText_endAnchor0(HText *text, int number,
 	     * content, but shorten its extent by any trailing
 	     * blank lines we've detected.  -FM
 	     */
-	    a->extent -= ((BlankExtent < a->extent) ?
-			  BlankExtent : 0);
+	    a->extent = (short) (a->extent - ((BlankExtent < a->extent)
+					      ? BlankExtent
+					      : 0));
 	}
 	if (BlankExtent || a->extent <= 0 || a->number <= 0) {
 	    CTRACE((tfp,
@@ -5843,7 +5852,7 @@ static void HText_trimHightext(HText *text,
 	    continue;
 
 	if (anchor_ptr->line_pos > (int) line_ptr->size) {
-	    anchor_ptr->line_pos = line_ptr->size;
+	    anchor_ptr->line_pos = (short) line_ptr->size;
 	}
 	if (anchor_ptr->line_pos < 0) {
 	    anchor_ptr->line_pos = 0;
@@ -5913,7 +5922,7 @@ static void HText_trimHightext(HText *text,
 	    LYClearHiText(anchor_ptr);
 	    LYSetHiText(anchor_ptr,
 			&line_ptr->data[anchor_ptr->line_pos],
-			size);
+			(unsigned) size);
 	} else {
 	    LYClearHiText(anchor_ptr);
 	    LYSetHiText(anchor_ptr, "", 0);
@@ -5924,7 +5933,7 @@ static void HText_trimHightext(HText *text,
 	 * data structure.
 	 */
 	hilite_str = LYGetHiTextStr(anchor_ptr, 0);
-	hilite_len = strlen(hilite_str);
+	hilite_len = (int) strlen(hilite_str);
 	actual_len = anchor_ptr->extent;
 
 	line_ptr2 = line_ptr;
@@ -5957,7 +5966,7 @@ static void HText_trimHightext(HText *text,
 		StrnAllocCopy(hi_string,
 			      line_ptr2->data,
 			      (actual_len - hilite_len));
-		actual_len -= strlen(hi_string);
+		actual_len -= (int) strlen(hi_string);
 		/*handle LY_SOFT_NEWLINEs -VH */
 		hi_offset += remove_special_attr_chars(hi_string);
 
@@ -6014,16 +6023,16 @@ static void HText_trimHightext(HText *text,
 		    have_soft_newline_in_1st_line += (line_ptr->data[i] == LY_SOFT_NEWLINE);
 		}
 	    }
-	    anchor_ptr->line_pos -= offset;
+	    anchor_ptr->line_pos = (short) (anchor_ptr->line_pos - offset);
 	    /*handle LY_SOFT_NEWLINEs -VH */
-	    anchor_ptr->line_pos += have_soft_newline_in_1st_line;
+	    anchor_ptr->line_pos = (short) (anchor_ptr->line_pos + have_soft_newline_in_1st_line);
 	}
 #endif /* WIDEC_CURSES */
 
 	/*
 	 * Set the line number.
 	 */
-	anchor_ptr->line_pos += line_ptr->offset;
+	anchor_ptr->line_pos = (short) (anchor_ptr->line_pos + line_ptr->offset);
 	anchor_ptr->line_num = cur_line;
 
 	CTRACE((tfp, "GridText:     add link on line %d col %d [%d] %s\n",
@@ -6801,7 +6810,7 @@ int HText_getNumOfBytes(void)
 	for (line = FirstHTLine(HTMainText);
 	     line != HTMainText->last_line;
 	     line = line->next) {
-	    result += 1 + strlen(line->data);
+	    result += 1 + (int) strlen(line->data);
 	}
     }
     return result;
@@ -7817,7 +7826,7 @@ static void write_hyphen(FILE *fp)
  */
 static int TrimmedLength(char *string)
 {
-    int result = strlen(string);
+    int result = (int) strlen(string);
 
     if (!HTisDocumentSource()) {
 	int adjust = result;
@@ -7951,7 +7960,7 @@ static AnchorIndex **allocAnchorIndex(unsigned *size)
 			p->filler = ' ';
 			break;
 		    }
-		    p->length = strlen(p->value);
+		    p->length = (int) strlen(p->value);
 
 		    if ((q = result[anchor->line_num]) != NULL) {
 			/* insert, ordering by offset */
@@ -9852,9 +9861,9 @@ char *HText_setLastOptionValue(HText *text, char *value,
 	}
 
 	if (checked) {
-	    int curlen = strlen(new_ptr->name);
+	    int curlen = (int) strlen(new_ptr->name);
 	    int newlen = (HTCurSelectedOptionValue
-			  ? strlen(HTCurSelectedOptionValue)
+			  ? (int) strlen(HTCurSelectedOptionValue)
 			  : 0);
 	    FormInfo *last_input = text->last_anchor->input_field;
 
@@ -9883,7 +9892,7 @@ char *HText_setLastOptionValue(HText *text, char *value,
 	    if (HTCurSelectedOptionValue == 0)
 		StrAllocCopy(HTCurSelectedOptionValue, "");
 	    text->last_anchor->input_field->size =
-		strlen(HTCurSelectedOptionValue);
+		(int) strlen(HTCurSelectedOptionValue);
 	    ret_Value = HTCurSelectedOptionValue;
 	}
     }
@@ -9943,7 +9952,7 @@ int HText_beginInput(HText *text, BOOL underline,
     a->sgml_offset = SGML_offset();
     a->inUnderline = underline;
     a->line_num = text->Lines;
-    a->line_pos = text->last_line->size;
+    a->line_pos = (short) text->last_line->size;
 
     /*
      * If this is a radio button, or an OPTION we're converting
@@ -10079,7 +10088,7 @@ int HText_beginInput(HText *text, BOOL underline,
      * Set MAXLENGTH.
      */
     if (I->maxlength != NULL) {
-	f->maxlength = atoi(I->maxlength);
+	f->maxlength = (unsigned) atoi(I->maxlength);
     } else {
 	f->maxlength = 0;	/* 0 means infinite */
     }
@@ -10205,14 +10214,14 @@ int HText_beginInput(HText *text, BOOL underline,
      */
     if (f->type == F_RESET_TYPE) {
 	if (non_empty(f->value)) {
-	    f->size = strlen(f->value);
+	    f->size = (int) strlen(f->value);
 	} else {
 	    StrAllocCopy(f->value, "Reset");
 	    f->size = 5;
 	}
     } else if (f->type == F_BUTTON_TYPE) {
 	if (non_empty(f->value)) {
-	    f->size = strlen(f->value);
+	    f->size = (int) strlen(f->value);
 	} else {
 	    StrAllocCopy(f->value, "BUTTON");
 	    f->size = 5;
@@ -10220,7 +10229,7 @@ int HText_beginInput(HText *text, BOOL underline,
     } else if (f->type == F_IMAGE_SUBMIT_TYPE ||
 	       f->type == F_SUBMIT_TYPE) {
 	if (non_empty(f->value)) {
-	    f->size = strlen(f->value);
+	    f->size = (int) strlen(f->value);
 	} else if (f->type == F_IMAGE_SUBMIT_TYPE) {
 	    StrAllocCopy(f->value, "[IMAGE]-Submit");
 	    f->size = 14;
@@ -10295,7 +10304,7 @@ int HText_beginInput(HText *text, BOOL underline,
     }
     if (fields_are_numbered() && (a->number > 0)) {
 	sprintf(marker, "[%d]", a->number);
-	adjust_marker = strlen(marker);
+	adjust_marker = (int) strlen(marker);
 	if (number_fields_on_left) {
 	    BOOL had_bracket = (BOOL) (f->type == F_OPTION_LIST_TYPE);
 
@@ -10304,7 +10313,7 @@ int HText_beginInput(HText *text, BOOL underline,
 		HText_appendCharacter(text, '[');
 	}
 	a->line_num = text->Lines;
-	a->line_pos = text->last_line->size;
+	a->line_pos = (short) text->last_line->size;
     } else {
 	*marker = '\0';
     }
@@ -10340,7 +10349,7 @@ int HText_beginInput(HText *text, BOOL underline,
 		&& MaximumSize > a->line_pos + 10)
 		MaximumSize -= a->line_pos;
 	    else
-		MaximumSize -= strlen(marker);
+		MaximumSize -= (int) strlen(marker);
 	}
 
 	/*
@@ -10555,7 +10564,7 @@ static void load_a_file(const char *val_used,
 	    HTAlert(gettext("Can't open file for uploading"));
 	} else {
 	    while ((bytes = fread(buffer, sizeof(char), 256, fd)) != 0) {
-		HTSABCat(result, buffer, bytes);
+		HTSABCat(result, buffer, (int) bytes);
 	    }
 	    LYCloseInput(fd);
 	}
@@ -10614,9 +10623,9 @@ static unsigned check_form_specialchars(const char *value)
 static void UpdateBoundary(char **Boundary,
 			   bstring *data)
 {
-    int j;
-    int have = strlen(*Boundary);
-    int last = BStrLen(data);
+    size_t j;
+    size_t have = strlen(*Boundary);
+    size_t last = (size_t) BStrLen(data);
     char *text = BStrData(data);
     char *want = *Boundary;
 
@@ -10641,7 +10650,7 @@ static void UpdateBoundary(char **Boundary,
  * Convert a string to base64
  */
 static char *convert_to_base64(const char *src,
-			       int len)
+			       size_t len)
 {
 #define B64_LINE       76
 
@@ -10649,12 +10658,12 @@ static char *convert_to_base64(const char *src,
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
     char *dest;
-    int rlen;			/* length of result string */
+    size_t rlen;		/* length of result string */
     unsigned char c1, c2, c3;
     const char *eol;
     char *r;
     const char *str;
-    int eollen;
+    size_t eollen;
     int chunk;
 
     str = src;
@@ -11034,7 +11043,7 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc, char *link_name,
      * can organize the data.
      */
     if (anchor_limit != 0) {
-	my_data = typecallocn(PostData, anchor_limit);
+	my_data = typecallocn(PostData, (size_t) anchor_limit);
 	if (my_data == 0)
 	    outofmem(__FILE__, "HText_SubmitForm");
 	assert(my_data != NULL);
@@ -11419,6 +11428,7 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc, char *link_name,
 		    my_data[anchor_count].quote = QUOTE_BASE64;
 		    escaped2 =
 			convert_to_base64(BStrData(my_data[anchor_count].data),
+					  (size_t)
 					  BStrLen(my_data[anchor_count].data));
 		    BStrCopy0(my_data[anchor_count].data, escaped2);
 		    FREE(escaped2);
@@ -12299,7 +12309,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
     if (*lx_val != 0) {
 	nxt_anchor = st_anchor;
 	while ((nxt_anchor) && (nxt_anchor->line_num == a->line_num)) {
-	    nxt_anchor->line_pos += *lx_val;
+	    nxt_anchor->line_pos = (short) (nxt_anchor->line_pos + *lx_val);
 	    nxt_anchor = nxt_anchor->next;
 	}
 	fixup = *lx_val;
@@ -12365,7 +12375,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 			(*old_val)++;
 		    val += incr;
 		    sprintf(s, "%d", val);
-		    new_n = strlen(s);
+		    new_n = (int) strlen(s);
 		    s += new_n;
 		    p += n;
 
@@ -12394,7 +12404,8 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 			nxt_anchor = st_anchor;
 			while ((nxt_anchor) &&
 			       (nxt_anchor->line_num == a->line_num)) {
-			    nxt_anchor->line_pos += new_n;
+			    nxt_anchor->line_pos = (short) (nxt_anchor->line_pos
+							    + new_n);
 			    nxt_anchor = nxt_anchor->next;
 			}
 			if (st_anchor)
@@ -12414,8 +12425,8 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 	     *
 	     * We use lxbuf[] to deal with the two lines involved.
 	     */
-	    pre_n = strlen(p);	/* count of 1st part chars in this line */
-	    post_n = strlen(ht->next->data);
+	    pre_n = (int) strlen(p);	/* count of 1st part chars in this line */
+	    post_n = (int) strlen(ht->next->data);
 	    if (plx
 		&& (pre_n + post_n + 2 < (int) sizeof(lxbuf))) {
 		strcpy(lx, p);	/* <- 1st part of a possible lx'ing tag */
@@ -12453,7 +12464,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 			    (*old_val)++;
 			val += incr;
 			sprintf(lx, "%d", val);
-			new_n = strlen(lx);
+			new_n = (int) strlen(lx);
 			strcat(lx, strchr(ht->next->data, ']'));
 
 			/*
@@ -12465,7 +12476,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 			 * Keep track of any digits added, for the next
 			 * pass through.
 			 */
-			s = strncpy(s, lx, pre_n) + pre_n;
+			s = strncpy(s, lx, (size_t) pre_n) + pre_n;
 			lx += pre_n;
 			strcpy(ht->next->data, lx);
 
@@ -12479,7 +12490,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 
     *s = '\0';
 
-    n = strlen(ht->data);
+    n = (int) strlen(ht->data);
     if (mode == CHOP) {
 	*(buf + n) = '\0';
     } else if (strlen(buf) > ht->size) {
@@ -12496,6 +12507,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
 	POOLallocstyles(temp->styles, ht->numstyles);
 	if (!temp->styles)
 	    outofmem(__FILE__, "increment_tagged_htline");
+	assert(temp->styles != NULL);
 	memcpy(temp->styles, ht->styles, sizeof(HTStyleChange) * ht->numstyles);
 #endif
 	ht = temp;
@@ -12504,7 +12516,7 @@ static int increment_tagged_htline(HTLine *ht, TextAnchor *a, int *lx_val,
     }
     strcpy(ht->data, buf);
 
-    return (strlen(buf) - n + fixup);
+    return ((int) strlen(buf) - n + fixup);
 }
 
 /*
@@ -12749,7 +12761,7 @@ static void update_subsequent_anchors(int newlines,
 		line_adj = increment_tagged_htline(htline, anchor, &lx,
 						   &start_tag, newlines,
 						   NOCHOP);
-		htline->size += line_adj;
+		htline->size = (unsigned short) (htline->size + line_adj);
 		tag_adj += line_adj;
 
 	    } else {
@@ -12840,7 +12852,7 @@ static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
      */
     if ((stat(ed_temp, &stat_info) < 0) ||
 	!S_ISREG(stat_info.st_mode) ||
-	((size = stat_info.st_size) == 0)) {
+	((size = (size_t) stat_info.st_size) == 0)) {
 	size = 0;
 	ebuf = typecalloc(char);
 
@@ -12898,7 +12910,7 @@ static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
 
 	if (skip_at) {
 	    len0 = skip_at - lp;
-	    strncpy(line, lp, len0);
+	    strncpy(line, lp, (size_t) len0);
 	    line[len0] = '\0';
 	    lp = skip_at + skip_num;
 	    skip_at = NULL;
@@ -12913,7 +12925,7 @@ static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
 	if ((cp = strchr(lp, '\n')) != 0)
 	    len = cp - lp;
 	else
-	    len = strlen(lp);
+	    len = (int) strlen(lp);
 
 	if (wanted_fieldlen_wrap < 0 && !wrapalert &&
 	    len0 + len >= start_anchor->input_field->size &&
@@ -12989,7 +13001,7 @@ static int finish_ExtEditForm(LinkInfo * form_link, TextAnchor *start_anchor,
 		len = MAX_LINE - len0 - 1;
 	}
 
-	strncat(line, lp, len);
+	strncat(line, lp, (size_t) len);
 	*(line + len0 + len) = '\0';
 
 	/*
@@ -13490,7 +13502,7 @@ int HText_InsertFile(LinkInfo * form_link)
 	if ((cp = strchr(lp, '\n')) != 0)
 	    len = cp - lp;
 	else
-	    len = strlen(lp);
+	    len = (int) strlen(lp);
 
 	if (len >= MAX_LINE) {
 	    if (!truncalert) {
@@ -13501,7 +13513,7 @@ int HText_InsertFile(LinkInfo * form_link)
 	    if (lp[len])
 		lp[len + 1] = '\0';	/* prevent next iteration */
 	}
-	strncpy(line, lp, len);
+	strncpy(line, lp, (size_t) len);
 	*(line + len) = '\0';
 
 	/*
diff --git a/src/HTInit.c b/src/HTInit.c
index c0e1203e..4d6e921a 100644
--- a/src/HTInit.c
+++ b/src/HTInit.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTInit.c,v 1.72 2010/04/29 23:50:21 tom Exp $
+ * $LynxId: HTInit.c,v 1.73 2010/06/17 08:13:52 tom Exp $
  *
  *		Configuration-specific Initialization		HTInit.c
  *		----------------------------------------
@@ -676,14 +676,14 @@ static int BuildCommand(HTChunk *cmd,
     for (from = controlstring; *from != '\0'; from++) {
 	if (escaped) {
 	    escaped = 0;
-	    HTChunkPutc(cmd, *from);
+	    HTChunkPutc(cmd, UCH(*from));
 	} else if (*from == '\\') {
 	    escaped = 1;
 	} else if (prefixed) {
 	    prefixed = 0;
 	    switch (*from) {
 	    case '%':		/* not defined */
-		HTChunkPutc(cmd, *from);
+		HTChunkPutc(cmd, UCH(*from));
 		break;
 	    case 'n':
 		/* FALLTHRU */
@@ -736,7 +736,7 @@ static int BuildCommand(HTChunk *cmd,
 	} else if (*from == '%') {
 	    prefixed = 1;
 	} else {
-	    HTChunkPutc(cmd, *from);
+	    HTChunkPutc(cmd, UCH(*from));
 	}
     }
     HTChunkTerminate(cmd);
diff --git a/src/HTML.c b/src/HTML.c
index 7367ba81..ce31d60a 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: HTML.c,v 1.137 2010/05/02 20:30:21 tom Exp $
+ * $LynxId: HTML.c,v 1.139 2010/06/18 00:05:37 tom Exp $
  *
  *		Structured stream to Rich hypertext converter
  *		============================================
@@ -323,7 +323,7 @@ void HTML_put_character(HTStructured * me, char c)
 	if (c == LY_SOFT_HYPHEN)
 	    return;
 	if (c != '\n' && c != '\t' && c != '\r') {
-	    HTChunkPutc(&me->title, c);
+	    HTChunkPutc(&me->title, UCH(c));
 	} else if (FIX_JAPANESE_SPACES) {
 	    if (c == '\t') {
 		HTChunkPutc(&me->title, ' ');
@@ -336,28 +336,28 @@ void HTML_put_character(HTStructured * me, char c)
 	return;
 
     case HTML_STYLE:
-	HTChunkPutc(&me->style_block, c);
+	HTChunkPutc(&me->style_block, UCH(c));
 	return;
 
     case HTML_SCRIPT:
-	HTChunkPutc(&me->script, c);
+	HTChunkPutc(&me->script, UCH(c));
 	return;
 
     case HTML_OBJECT:
-	HTChunkPutc(&me->object, c);
+	HTChunkPutc(&me->object, UCH(c));
 	return;
 
     case HTML_TEXTAREA:
-	HTChunkPutc(&me->textarea, c);
+	HTChunkPutc(&me->textarea, UCH(c));
 	return;
 
     case HTML_SELECT:
     case HTML_OPTION:
-	HTChunkPutc(&me->option, c);
+	HTChunkPutc(&me->option, UCH(c));
 	return;
 
     case HTML_MATH:
-	HTChunkPutc(&me->math, c);
+	HTChunkPutc(&me->math, UCH(c));
 	return;
 
     default:
@@ -375,7 +375,7 @@ void HTML_put_character(HTStructured * me, char c)
 	     */
 	    if (me->sp[0].tag_number == HTML_A)
 		break;
-	    HTChunkPutc(&me->option, c);
+	    HTChunkPutc(&me->option, UCH(c));
 	    return;
 	}
 	break;
@@ -752,6 +752,7 @@ static void addClassName(const char *prefix,
 	}
 	if (Style_className == NULL)
 	    outofmem(__FILE__, "addClassName");
+	assert(Style_className != NULL);
 	Style_className_end = Style_className + have;
     }
     if (offset)
@@ -7639,6 +7640,7 @@ HTStructured *HTML_new(HTParentAnchor *anchor,
     me = typecalloc(HTStructured);
     if (me == NULL)
 	outofmem(__FILE__, "HTML_new");
+    assert(me != NULL);
 
     /*
      * This used to call 'get_styles()' only on the first time through this
diff --git a/src/LYCgi.c b/src/LYCgi.c
index b9faca54..9409ae80 100644
--- a/src/LYCgi.c
+++ b/src/LYCgi.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCgi.c,v 1.57 2010/04/29 23:42:23 tom Exp $
+ * $LynxId: LYCgi.c,v 1.58 2010/06/17 10:44:09 tom Exp $
  *                   Lynx CGI support                              LYCgi.c
  *                   ================
  *
@@ -371,6 +371,11 @@ static int LYLoadCGI(const char *arg,
 	int wstatus;
 #endif
 
+	fd1[0] = -1;
+	fd1[1] = -1;
+	fd2[0] = -1;
+	fd2[1] = -1;
+
 	if (anAnchor->isHEAD || keep_mime_headers) {
 
 	    /* Show output as plain text */
diff --git a/src/LYCookie.c b/src/LYCookie.c
index c549bdaa..5d22a072 100644
--- a/src/LYCookie.c
+++ b/src/LYCookie.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCookie.c,v 1.99 2010/04/29 23:42:23 tom Exp $
+ * $LynxId: LYCookie.c,v 1.100 2010/06/17 21:31:03 tom Exp $
  *
  *			       Lynx Cookie Support		   LYCookie.c
  *			       ===================
@@ -672,19 +672,22 @@ static char *scan_cookie_sublist(char *hostname,
 				 char *header,
 				 BOOL secure)
 {
-    HTList *hl = sublist, *next = NULL;
+    HTList *hl;
     cookie *co;
     time_t now = time(NULL);
     int len = 0;
     char crlftab[8];
 
     sprintf(crlftab, "%c%c%c", CR, LF, '\t');
-    while (hl) {
+    for (hl = sublist; hl != NULL; hl = hl->next) {
 	co = (cookie *) hl->object;
-	next = hl->next;
 
-	if ((co) &&		/* speed-up host_matches() and limit trace output */
-	    (LYstrstr(hostname, co->domain) != NULL)) {
+	if (co == NULL) {
+	    continue;
+	}
+
+	/* speed-up host_matches() and limit trace output */
+	if (LYstrstr(hostname, co->domain) != NULL) {
 	    CTrace((tfp, "Checking cookie %p %s=%s\n",
 		    (void *) hl,
 		    (co->name ? co->name : "(no name)"),
@@ -704,7 +707,7 @@ static char *scan_cookie_sublist(char *hostname,
 	/*
 	 * Check if this cookie has expired, and if so, delete it.
 	 */
-	if (((co) && (co->flags & COOKIE_FLAG_EXPIRES_SET)) &&
+	if ((co->flags & COOKIE_FLAG_EXPIRES_SET) &&
 	    co->expires <= now) {
 	    HTList_removeObject(sublist, co);
 	    freeCookie(co);
@@ -715,8 +718,9 @@ static char *scan_cookie_sublist(char *hostname,
 	/*
 	 * Check if we have a unexpired match, and handle if we do.
 	 */
-	if (((co != NULL) &&
-	     host_matches(hostname, co->domain)) &&
+	if (co->domain != 0 &&
+	    co->name != 0 &&
+	    host_matches(hostname, co->domain) &&
 	    (co->pathlen == 0 || is_prefix(co->path, path))) {
 	    /*
 	     * Skip if the secure flag is set and we don't have a secure
@@ -724,7 +728,6 @@ static char *scan_cookie_sublist(char *hostname,
 	     * secure.  - FM
 	     */
 	    if ((co->flags & COOKIE_FLAG_SECURE) && secure == FALSE) {
-		hl = next;
 		continue;
 	    }
 
@@ -733,7 +736,6 @@ static char *scan_cookie_sublist(char *hostname,
 	     * - FM
 	     */
 	    if (co->PortList && !port_matches(port, co->PortList)) {
-		hl = next;
 		continue;
 	    }
 
@@ -829,7 +831,6 @@ static char *scan_cookie_sublist(char *hostname,
 		}
 	    }
 	}
-	hl = next;
     }
 
     return (header);
diff --git a/src/LYCurses.c b/src/LYCurses.c
index 611534ee..c0209666 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.150 2010/05/03 00:09:05 tom Exp $ */
+/* $LynxId: LYCurses.c,v 1.151 2010/06/17 08:09:48 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -470,7 +470,7 @@ void curses_w_style(WINDOW * win, int style,
     if (style == s_normal && dir) {
 	LYAttrset(win, ds->color, ds->mono);
 	if (win == LYwin)
-	    SetCachedStyle(YP, XP, s_normal);
+	    SetCachedStyle(YP, XP, (unsigned) s_normal);
 	return;
     }
 
@@ -516,7 +516,7 @@ void curses_w_style(WINDOW * win, int style,
 	    CTRACE2(TRACE_STYLE, (tfp, "CACHED: <%s> @(%d,%d)\n",
 				  ds->name, YP, XP));
 	    if (win == LYwin)
-		SetCachedStyle(YP, XP, style);
+		SetCachedStyle(YP, XP, (unsigned) style);
 	}
 	LYAttrset(win, ds->color, ds->mono);
 	break;
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 0805e187..4cabe593 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYGlobalDefs.h,v 1.123 2010/05/05 09:19:31 tom Exp $
+ * $LynxId: LYGlobalDefs.h,v 1.124 2010/06/18 00:12:13 tom Exp $
  *
  * global variable definitions
  */
@@ -305,6 +305,7 @@ extern "C" {
     extern int max_cookies_buffer;
     extern int max_cookies_domain;
     extern int max_cookies_global;
+    extern int max_uri_size;
 #ifdef USE_SESSIONS
     extern short session_limit;	/* maximal entries saved/restored
 				   in session file */
diff --git a/src/LYLocal.c b/src/LYLocal.c
index 932b2aa8..a4a4502f 100644
--- a/src/LYLocal.c
+++ b/src/LYLocal.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYLocal.c,v 1.106 2010/04/29 23:43:55 tom Exp $
+ * $LynxId: LYLocal.c,v 1.108 2010/06/17 21:18:00 tom Exp $
  *
  *  Routines to manipulate the local filesystem.
  *  Written by: Rick Mallett, Carleton University
@@ -1500,8 +1500,9 @@ static int permit_location(char *destpath,
 		     */
 		    if (!no_change_exec_perms
 			|| strchr(cp + 5, 'X') == NULL
-			|| S_ISDIR(dir_info.st_mode))
-			new_mode |= mask;
+			|| S_ISDIR(dir_info.st_mode)) {
+			new_mode |= (mode_t) mask;
+		    }
 		} else {
 		    HTAlert(gettext("Invalid mode format."));
 		    return code;
@@ -2032,6 +2033,7 @@ int dired_options(DocInfo *doc, char **newfile)
 
     } else {
 	StrAllocCopy(path, "");
+	memset(&dir_info, 0, sizeof(dir_info));
     }
 
     dir = HTfullURL_toFile(doc->address);
diff --git a/src/LYMain.c b/src/LYMain.c
index afb1145b..acd63897 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.213 2010/05/05 09:19:31 tom Exp $
+ * $LynxId: LYMain.c,v 1.214 2010/06/18 00:12:27 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -494,6 +494,7 @@ int lynx_temp_subspace = 0;	/* > 0 if we made temp-directory */
 int max_cookies_domain = 50;
 int max_cookies_global = 500;
 int max_cookies_buffer = 4096;
+int max_uri_size = 8192;
 int nlinks = 0;			/* number of links in memory */
 int outgoing_mail_charset = -1;	/* translate mail to this charset */
 
diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c
index ebf6a891..6a21d04b 100644
--- a/src/LYMainLoop.c
+++ b/src/LYMainLoop.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMainLoop.c,v 1.164 2010/05/05 09:48:38 tom Exp $
+ * $LynxId: LYMainLoop.c,v 1.165 2010/06/17 10:51:11 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTAccess.h>
@@ -1453,6 +1453,7 @@ static int handle_LYK_ACTIVATE(int *c,
 			 !strcmp(curdoc.title, HISTORY_PAGE_TITLE))) ||
 		       curdoc.bookmark != NULL ||
 		       (lynxjumpfile &&
+			curdoc.address &&
 			!strcmp(lynxjumpfile, curdoc.address))) {
 		LYUserSpecifiedURL = TRUE;
 	    } else if (no_filereferer == TRUE && isFILE_URL(curdoc.address)) {
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 78f02849..e347b873 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.149 2010/05/05 09:19:31 tom Exp $
+ * $LynxId: LYReadCFG.c,v 1.150 2010/06/18 00:11:35 tom Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -1481,6 +1481,7 @@ static Config_Type Config_Table [] =
      PARSE_INT(RC_MAX_COOKIES_BUFFER,   max_cookies_buffer),
      PARSE_INT(RC_MAX_COOKIES_DOMAIN,   max_cookies_domain),
      PARSE_INT(RC_MAX_COOKIES_GLOBAL,   max_cookies_global),
+     PARSE_INT(RC_MAX_URI_SIZE,         max_uri_size),
      PARSE_TIM(RC_MESSAGESECS,          MessageSecs),
      PARSE_SET(RC_MINIMAL_COMMENTS,     minimal_comments),
      PARSE_PRG(RC_MKDIR_PATH,           ppMKDIR),
diff --git a/src/LYStrings.c b/src/LYStrings.c
index 027cb253..cd0ab51b 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.172 2010/05/05 09:19:31 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.173 2010/06/17 10:50:14 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -5846,6 +5846,7 @@ char *SNACopy(char **dest,
 	if (*dest == NULL) {
 	    CTRACE((tfp, "Tried to malloc %d bytes\n", n));
 	    outofmem(__FILE__, "SNACopy");
+	    assert(*dest != NULL);
 	}
 	strncpy(*dest, src, (unsigned) n);
 	*(*dest + n) = '\0';	/* terminate */
@@ -5867,6 +5868,7 @@ char *SNACat(char **dest,
 	    *dest = (char *) realloc(*dest, (unsigned) (length + n + 1));
 	    if (*dest == NULL)
 		outofmem(__FILE__, "SNACat");
+	    assert(*dest != NULL);
 	    strncpy(*dest + length, src, (unsigned) n);
 	    *(*dest + length + n) = '\0';	/* terminate */
 	} else {
@@ -5874,6 +5876,7 @@ char *SNACat(char **dest,
 
 	    if (*dest == NULL)
 		outofmem(__FILE__, "SNACat");
+	    assert(*dest != NULL);
 	    memcpy(*dest, src, (unsigned) n);
 	    (*dest)[n] = '\0';	/* terminate */
 	}
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index f1ee99b0..7915b64b 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYrcFile.h,v 1.34 2009/11/27 11:16:04 tom Exp $
+ * $LynxId: LYrcFile.h,v 1.35 2010/06/18 00:08:05 tom Exp $
  */
 #ifndef LYRCFILE_H
 #define LYRCFILE_H
@@ -134,6 +134,7 @@
 #define RC_MAX_COOKIES_BUFFER           "max_cookies_buffer"
 #define RC_MAX_COOKIES_DOMAIN           "max_cookies_domain"
 #define RC_MAX_COOKIES_GLOBAL           "max_cookies_global"
+#define RC_MAX_URI_SIZE                 "max_uri_size"
 #define RC_MESSAGESECS                  "messagesecs"
 #define RC_MINIMAL_COMMENTS             "minimal_comments"
 #define RC_MKDIR_PATH                   "mkdir_path"
diff --git a/src/UCdomap.c b/src/UCdomap.c
index 6c7bcffd..f41093c2 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCdomap.c,v 1.78 2010/04/29 09:16:49 tom Exp $
+ * $LynxId: UCdomap.c,v 1.79 2010/06/17 09:44:47 tom Exp $
  *
  *  UCdomap.c
  *  =========
@@ -1804,7 +1804,7 @@ static const char **UC_setup_LYCharSets_repl(int UC_charset_in_hndl,
 	     * one valid eightbit latin1 char.
 	     */
 	    if (ti[UCH(*s8) - 160] >= UCH(lowest8) &&
-		!(s7[0] == ti[UCH(*s8) - 160] &&
+		!(UCH(s7[0]) == ti[UCH(*s8) - 160] &&
 		  s7[1] == '\0')) {
 		/*
 		 * ...which in turn is mapped, by our "new method",
diff --git a/src/chrtrans/makeuctb.c b/src/chrtrans/makeuctb.c
index e3db8a51..916e32fa 100644
--- a/src/chrtrans/makeuctb.c
+++ b/src/chrtrans/makeuctb.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: makeuctb.c,v 1.43 2010/05/03 00:45:10 tom Exp $
+ * $LynxId: makeuctb.c,v 1.44 2010/06/17 08:06:46 tom Exp $
  *
  *  makeuctb.c, derived from conmakehash.c   - kw
  *
@@ -194,7 +194,7 @@ static void addpair_str(char *str, int un)
 		    MAX_UNIPAIRS);
 	    done(EX_DATAERR);
 	}
-	themap_str.entries[themap_str.entry_ct].unicode = un;
+	themap_str.entries[themap_str.entry_ct].unicode = (u16) un;
 	themap_str.entries[themap_str.entry_ct].replace_str = str;
 	themap_str.entry_ct++;
     }
@@ -238,7 +238,7 @@ static void addpair(int fp, int un)
 	    fprintf(stderr, "ERROR: Only 255 unicodes/glyph permitted!\n");
 	    done(EX_DATAERR);
 	}
-	unitable[fp][unicount[fp]] = un;
+	unitable[fp][unicount[fp]] = (u16) un;
 	unicount[fp]++;
     }
     /* otherwise: ignore */
@@ -751,7 +751,7 @@ int main(int argc, char **argv)
 	}
     }
     for (p = this_MIMEcharset; *p; p++) {
-	*p = TOLOWER(*p);
+	*p = (char) TOLOWER(*p);
     }
     if (argc > 4) {
 	strncpy(this_LYNXcharset, argv[4], UC_MAXLEN_LYNXCSNAME);
@@ -771,7 +771,7 @@ int main(int argc, char **argv)
 	for (i = 0, p = this_MIMEcharset;
 	     *p && (i < UC_MAXLEN_ID_APPEND - 1);
 	     p++, i++) {
-	    id_append[i + 1] = isalnum(UCH(*p)) ? *p : '_';
+	    id_append[i + 1] = (char) (isalnum(UCH(*p)) ? *p : '_');
 	}
 	id_append[i + 1] = '\0';
     }