about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2021-06-10 00:37:08 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2021-06-10 00:37:08 +0000
commit15b5916ed82c8de48b85d7b7afe670cb00e79796 (patch)
treeb7891e7faa9ffaa27911b367d0551a38d03a53a6 /src
parentc2036b385da968e77c3abbefa44cb4c88eff9512 (diff)
downloadlynx-snapshots-15b5916ed82c8de48b85d7b7afe670cb00e79796.tar.gz
snapshot of project "lynx", label v2-9-0dev_6j
Diffstat (limited to 'src')
-rw-r--r--src/GridText.c15
-rw-r--r--src/LYCharUtils.c6
-rw-r--r--src/LYCurses.c23
-rw-r--r--src/LYEdit.c4
-rw-r--r--src/LYHistory.c33
-rw-r--r--src/LYHistory.h4
-rw-r--r--src/LYKeymap.c7
-rw-r--r--src/LYMain.c16
-rw-r--r--src/LYReadCFG.c16
-rw-r--r--src/LYStrings.c11
-rw-r--r--src/LYStructs.h4
-rw-r--r--src/LYStyle.c4
-rw-r--r--src/LYUtils.c6
-rw-r--r--src/UCAuto.c9
-rw-r--r--src/UCAux.c9
-rw-r--r--src/UCdomap.c4
-rw-r--r--src/parsdate.c17
-rw-r--r--src/parsdate.y3
18 files changed, 110 insertions, 81 deletions
diff --git a/src/GridText.c b/src/GridText.c
index 46cbb51f..88e2efe7 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: GridText.c,v 1.325 2020/02/25 01:41:00 tom Exp $
+ * $LynxId: GridText.c,v 1.328 2021/06/09 23:35:23 tom Exp $
  *
  *		Character grid hypertext object
  *		===============================
@@ -5935,10 +5935,12 @@ static void HText_trimHightext(HText *text,
 	/*
 	 * Find the right line.
 	 */
-	for (; anchor_ptr->line_num > cur_line;
+	for (; line_ptr != NULL && anchor_ptr->line_num > cur_line;
 	     line_ptr = line_ptr->next, cur_line++) {
 	    ;			/* null body */
 	}
+	if (line_ptr == NULL)
+	    continue;
 
 	if (!final) {
 	    /*
@@ -8308,7 +8310,9 @@ void print_wwwfile_to_fd(FILE *fp,
 			     off2, cur->length,
 			     FieldFirst(cur, this_wrap),
 			     FieldLast(cur, this_wrap) - 1,
-			     byte_offset, cell_chr, temp_chr));
+			     byte_offset,
+			     (unsigned) cell_chr,
+			     (unsigned) temp_chr));
 		    cell_chr = temp_chr;
 		    cell_ptr = temp_ptr;
 		    cell_len = temp_len;
@@ -10958,7 +10962,7 @@ static int check_if_base64_needed(int submit_method,
 	    int ch = UCH(text[n]);
 
 	    if (is8bits(ch) || ((ch < 32 && ch != '\n'))) {
-		CTRACE((tfp, "nonprintable %d:%#x\n", n, ch));
+		CTRACE((tfp, "nonprintable %d:%#x\n", n, (unsigned) ch));
 		printable = FALSE;
 	    }
 	    if (ch == '\n' || ch == '\r') {
@@ -13484,6 +13488,9 @@ void HText_ExpandTextarea(LinkInfo * form_link, int newlines)
 	anchor_ptr = anchor_ptr->next;
     }
 
+    if (end_anchor == NULL)
+	return;
+
     for (i = 1; i <= newlines; i++) {
 	insert_new_textarea_anchor(&end_anchor, &htline);
 
diff --git a/src/LYCharUtils.c b/src/LYCharUtils.c
index 4a7c3a39..bb05aab0 100644
--- a/src/LYCharUtils.c
+++ b/src/LYCharUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYCharUtils.c,v 1.133 2020/01/21 21:36:01 tom Exp $
+ * $LynxId: LYCharUtils.c,v 1.135 2021/06/09 22:29:03 tom Exp $
  *
  *  Functions associated with LYCharSets.c and the Lynx version of HTML.c - FM
  *  ==========================================================================
@@ -1665,7 +1665,7 @@ char **LYUCFullyTranslateString(char **str,
 	    } else if (code == 8204 || code == 8205 ||
 		       code == 8206 || code == 8207) {
 		CTRACE((tfp, "LYUCFullyTranslateString: Ignoring '%"
-			PRI_UCode_t "'.\n", code));
+			PRI_UCode_t "'.\n", CAST_UCode_t (code)));
 		replace_buf[0] = '\0';
 		state = S_got_outstring;
 		break;
@@ -1739,7 +1739,7 @@ char **LYUCFullyTranslateString(char **str,
 	    } else if (!T.output_utf8 && stype == st_HTML && !hidden &&
 		       !(HTPassEightBitRaw &&
 			 UCH(*p) >= lowest_8)) {
-		sprintf(replace_buf, "U%.2" PRI_UCode_t "", code);
+		sprintf(replace_buf, "U%.2" PRI_UCode_t "", CAST_UCode_t (code));
 
 		state = S_got_outstring;
 	    } else {
diff --git a/src/LYCurses.c b/src/LYCurses.c
index ae06fa9e..b35f5362 100644
--- a/src/LYCurses.c
+++ b/src/LYCurses.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYCurses.c,v 1.196 2020/01/21 21:35:05 tom Exp $ */
+/* $LynxId: LYCurses.c,v 1.197 2021/06/09 21:44:35 tom Exp $ */
 #include <HTUtils.h>
 #include <HTAlert.h>
 
@@ -408,7 +408,7 @@ void setHashStyle(int style,
 
     CTRACE2(TRACE_STYLE,
 	    (tfp, "CSS(SET): <%s> hash=%d, ca=%#x, ma=%#x\n",
-	     element, style, color, mono));
+	     element, style, (unsigned) color, (unsigned) mono));
 
     ds->used = TRUE;
     ds->color = color;
@@ -428,11 +428,13 @@ static void LYAttrset(WINDOW * win, int color,
 	&& LYShowColor >= SHOW_COLOR_ON
 	&& color >= 0) {
 	CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset color %#x -> (%s)\n",
-			      color, shown = attr_to_string(color)));
+			      (unsigned) color,
+			      shown = attr_to_string(color)));
 	(void) wattrset(win, color);
     } else if (mono >= 0) {
 	CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset mono %#x -> (%s)\n",
-			      mono, shown = attr_to_string(mono)));
+			      (unsigned) mono,
+			      shown = attr_to_string(mono)));
 	(void) wattrset(win, mono);
     } else {
 	CTRACE2(TRACE_STYLE, (tfp, "CSS:LYAttrset (A_NORMAL)\n"));
@@ -468,7 +470,9 @@ void curses_w_style(WINDOW * win, int style,
 
     CTRACE2(TRACE_STYLE, (tfp, "CSS.CS:<%s%s> style %d color %#x\n",
 			  (dir ? "" : "/"),
-			  ds->name, style, ds->color));
+			  ds->name,
+			  style,
+			  (unsigned) ds->color));
 
     getyx(win, YP, XP);
 
@@ -496,7 +500,7 @@ void curses_w_style(WINDOW * win, int style,
 	if (last_colorattr_ptr >= MAX_LAST_STYLES) {
 	    CTRACE2(TRACE_STYLE, (tfp, "........... %s (0x%x) %s\r\n",
 				  "attribute cache FULL, dropping last",
-				  last_styles[last_colorattr_ptr],
+				  (unsigned) last_styles[last_colorattr_ptr],
 				  "in LynxChangeStyle(curses_w_style)"));
 	    last_colorattr_ptr = MAX_LAST_STYLES - 1;
 	}
@@ -721,8 +725,13 @@ char *LYgetTableString(int code)
     if (fg == 0 && bg == 0) {
 	fg = COLOR_WHITE;
     }
+
     CTRACE((tfp, "%#x -> %#x (mono %#x pair %d) fg=%d, bg=%d\n",
-	    mask, second, mono, pair, fg, bg));
+	    (unsigned) mask,
+	    (unsigned) second,
+	    (unsigned) mono,
+	    pair, fg, bg));
+
     for (n = 0; n < TABLESIZE(Mono_Attrs); ++n) {
 	if ((Mono_Attrs[n].code & mono) != 0) {
 	    if (result != 0)
diff --git a/src/LYEdit.c b/src/LYEdit.c
index ee0b8329..304bb4e2 100644
--- a/src/LYEdit.c
+++ b/src/LYEdit.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYEdit.c,v 1.42 2013/11/28 11:18:19 tom Exp $ */
+/* $LynxId: LYEdit.c,v 1.43 2021/06/09 21:39:57 tom Exp $ */
 #include <HTUtils.h>
 #include <HTParse.h>
 #include <HTAlert.h>
@@ -263,7 +263,7 @@ void edit_temporary_file(char *filename,
 	    int save_err = errno;
 
 	    CTRACE((tfp, "ExtEditForm: system() returned %d (0x%x), %s\n",
-		    rv, rv,
+		    rv, (unsigned) rv,
 		    (save_err
 		     ? LYStrerror(save_err)
 		     : "reason unknown")));
diff --git a/src/LYHistory.c b/src/LYHistory.c
index 1d7c84ae..4fd5567f 100644
--- a/src/LYHistory.c
+++ b/src/LYHistory.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYHistory.c,v 1.91 2020/01/21 21:34:20 tom Exp $
+ * $LynxId: LYHistory.c,v 1.94 2021/06/09 22:55:43 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -82,7 +82,7 @@ static void Visited_Links_free(void)
 static void trace_history(const char *tag)
 {
     if (TRACE) {
-	CTRACE((tfp, "HISTORY %s %d/%d (%d extra)\n",
+	CTRACE((tfp, "HISTORY %s %d/%u (%d extra)\n",
 		tag, nhist, size_history, nhist_extra));
 	CTRACE_FLUSH(tfp);
     }
@@ -338,29 +338,26 @@ static int are_identical(HistInfo * doc, DocInfo *doc1)
 	    && doc1->isHEAD == doc->hdoc.isHEAD);
 }
 
-void LYAllocHistory(int entries)
+void LYAllocHistory(unsigned entries)
 {
-    CTRACE((tfp, "LYAllocHistory %d vs %d\n", entries, size_history));
+    CTRACE((tfp, "LYAllocHistory %u vs %u\n", entries, size_history));
     if (entries + 1 >= size_history) {
-	unsigned want;
-	int save = size_history;
+	size_t want;
+	unsigned save = size_history;
 
-	size_history = (entries + 2) * 2;
-	want = (unsigned) size_history *(unsigned) sizeof(*history);
+	size_history += (entries + 2) * 2;
+	want = ((size_t) size_history) * sizeof(*history);
 
 	if (history == 0) {
-	    history = typeMallocn(HistInfo, want);
+	    history = typecallocn(HistInfo, want);
 	} else {
 	    history = typeRealloc(HistInfo, history, want);
+	    memset(&history[save], 0, size_history - save);
 	}
 	if (history == 0)
 	    outofmem(__FILE__, "LYAllocHistory");
-
-	while (save < size_history) {
-	    memset(&history[save++], 0, sizeof(history[0]));
-	}
     }
-    CTRACE((tfp, "...LYAllocHistory %d vs %d\n", entries, size_history));
+    CTRACE((tfp, "...LYAllocHistory %u vs %u\n", entries, size_history));
 }
 
 /*
@@ -410,7 +407,7 @@ int LYpush(DocInfo *doc, int force_push)
 	HDOC(nhist).link = doc->link;
 	HDOC(nhist).line = doc->line;
 	nhist_extra--;
-	LYAllocHistory(nhist);
+	LYAllocHistory((unsigned) nhist);
 	nhist++;
 	trace_history("LYpush: just move the cursor");
 	return 1;
@@ -427,7 +424,7 @@ int LYpush(DocInfo *doc, int force_push)
     /*
      * OK, push it...
      */
-    LYAllocHistory(nhist);
+    LYAllocHistory((unsigned) nhist);
     HDOC(nhist).link = doc->link;
     HDOC(nhist).line = doc->line;
 
@@ -571,7 +568,7 @@ void LYpop(DocInfo *doc)
 void LYhist_prev(DocInfo *doc)
 {
     trace_history("LYhist_prev");
-    if (nhist > 0 && (nhist_extra || nhist < size_history)) {
+    if (nhist > 0 && (nhist_extra || (unsigned) nhist < size_history)) {
 	nhist--;
 	nhist_extra++;
 	LYpop_num(nhist, doc);
@@ -608,7 +605,7 @@ int LYhist_next(DocInfo *doc, DocInfo *newdoc)
     /* Store the new position */
     HDOC(nhist).link = doc->link;
     HDOC(nhist).line = doc->line;
-    LYAllocHistory(nhist);
+    LYAllocHistory((unsigned) nhist);
     nhist++;
     nhist_extra--;
     LYpop_num(nhist, newdoc);
diff --git a/src/LYHistory.h b/src/LYHistory.h
index 68ec5248..a8f2b1ca 100644
--- a/src/LYHistory.h
+++ b/src/LYHistory.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYHistory.h,v 1.21 2010/09/25 00:45:55 tom Exp $
+ * $LynxId: LYHistory.h,v 1.22 2021/06/09 22:33:06 tom Exp $
  */
 #ifndef LYHISTORY_H
 #define LYHISTORY_H
@@ -18,7 +18,7 @@ extern "C" {
     extern int LYpush(DocInfo *doc, int force_push);
     extern int showhistory(char **newfile);
     extern void LYAddVisitedLink(DocInfo *doc);
-    extern void LYAllocHistory(int entries);
+    extern void LYAllocHistory(unsigned entries);
     extern void LYFreePostData(DocInfo *data);
     extern void LYFreeDocInfo(DocInfo *data);
     extern void LYhist_prev(DocInfo *doc);
diff --git a/src/LYKeymap.c b/src/LYKeymap.c
index b8bad31f..b05d0a3a 100644
--- a/src/LYKeymap.c
+++ b/src/LYKeymap.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYKeymap.c,v 1.120 2018/12/27 10:33:52 tom Exp $ */
+/* $LynxId: LYKeymap.c,v 1.122 2021/06/09 21:58:11 tom Exp $ */
 #include <HTUtils.h>
 #include <LYUtils.h>
 #include <LYGlobalDefs.h>
@@ -633,6 +633,7 @@ static Kcmd revmap[] =
 	    "")
 };
 
+
 #undef DATA
 /* *INDENT-OFF* */
 static const struct {
@@ -781,9 +782,9 @@ char *LYKeycodeToString(int c,
 	else if (TOASCII(c) < TOASCII(' '))
 	    sprintf(buf, "^%c", FROMASCII(TOASCII(c) | 0100));
 	else if (c >= 0400)
-	    sprintf(buf, "key-0x%x", c);
+	    sprintf(buf, "key-0x%x", (unsigned) c);
 	else
-	    sprintf(buf, "0x%x", c);
+	    sprintf(buf, "0x%x", (unsigned) c);
     }
     return buf;
 }
diff --git a/src/LYMain.c b/src/LYMain.c
index ad9c1fc2..14e015ec 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.291 2021/03/22 22:52:58 tom Exp $
+ * $LynxId: LYMain.c,v 1.293 2021/06/09 20:55:53 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -492,7 +492,7 @@ char *x_display = NULL;		/* display environment variable */
 
 HistInfo *history;
 int nhist = 0;			/* number of used history entries */
-int size_history;		/* number of allocated history entries */
+unsigned size_history;		/* number of allocated history entries */
 
 LinkInfo links[MAXLINKS];
 
@@ -2367,7 +2367,7 @@ void reload_read_cfg(void)
 	return;			/* can not write the very own file :( */
     }
 #ifdef USE_PERSISTENT_COOKIES
-    if (LYCookieFile != 0 && LYCookieSaveFile != 0) {
+    if (LYCookieFile != NULL && LYCookieSaveFile != NULL) {
 	/* set few safe flags: */
 	BOOLEAN persistent_cookies_flag = persistent_cookies;
 	char *LYCookieFile_flag = NULL;
@@ -2422,7 +2422,7 @@ void reload_read_cfg(void)
 	    persistent_cookies = persistent_cookies_flag;
 	    HTAlert(gettext("persistent cookies state will be changed in next session only."));
 	}
-	if (persistent_cookies) {
+	if (persistent_cookies && LYCookieFile_flag != NULL) {
 	    if (strcmp(LYCookieFile, LYCookieFile_flag)) {
 		StrAllocCopy(LYCookieFile, LYCookieFile_flag);
 		CTRACE((tfp,
@@ -2500,17 +2500,17 @@ static int parse_authentication(char *next_arg,
     /*
      * Authentication information for protected documents.
      */
-    char *auth_info = 0;
+    char *auth_info = NULL;
 
-    if (next_arg != 0) {
+    if (next_arg != NULL) {
 	StrAllocCopy(auth_info, next_arg);
 	memset(next_arg, ' ', strlen(next_arg));	/* Let's not show too much */
     }
 
-    if (auth_info != 0) {
+    if (auth_info != NULL) {
 	char *cp;
 
-	if ((cp = StrChr(auth_info, ':')) != 0) {	/* Pw */
+	if ((cp = StrChr(auth_info, ':')) != NULL) {	/* Pw */
 	    *cp++ = '\0';	/* Terminate ID */
 	    HTUnEscape(cp);
 	    StrAllocCopy(result[1], cp);
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index b79e58da..18bc34cf 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.198 2020/02/23 23:09:33 Keith.Bowes Exp $
+ * $LynxId: LYReadCFG.c,v 1.199 2021/06/09 21:49:32 tom Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -815,7 +815,10 @@ static int keymap_fun(char *key)
 		    if (!success)
 			fprintf(stderr,
 				gettext("setting of line-editor binding for key %s (0x%x) to 0x%x for %s failed\n"),
-				key, lkc, lec, efunc);
+				key,
+				(unsigned) lkc,
+				(unsigned) lec,
+				efunc);
 		    else
 			return 0;
 		}
@@ -827,11 +830,16 @@ static int keymap_fun(char *key)
 		    if (lec != -1) {
 			fprintf(stderr,
 				gettext("setting of line-editor binding for key %s (0x%x) to 0x%x for %s failed\n"),
-				key, lkc, lec, efunc);
+				key,
+				(unsigned) lkc,
+				(unsigned) lec,
+				efunc);
 		    } else {
 			fprintf(stderr,
 				gettext("setting of line-editor binding for key %s (0x%x) for %s failed\n"),
-				key, lkc, efunc);
+				key,
+				(unsigned) lkc,
+				efunc);
 		    }
 		}
 	    }
diff --git a/src/LYStrings.c b/src/LYStrings.c
index f4719f87..8cb33394 100644
--- a/src/LYStrings.c
+++ b/src/LYStrings.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYStrings.c,v 1.277 2020/09/04 00:34:02 tom Exp $ */
+/* $LynxId: LYStrings.c,v 1.278 2021/06/09 22:29:17 tom Exp $ */
 #include <HTUtils.h>
 #include <HTCJK.h>
 #include <UCAux.h>
@@ -1353,10 +1353,11 @@ static int setkey_cmd(char *parse)
 		    return 0;	/* Trace the failure and continue. */
 		}
 		if (LYTraceLogFP == 0) {
-		    MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x\n", keysym));
+		    MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x\n",
+			      (unsigned) keysym));
 		} else {
 		    MY_TRACE((tfp, "KEYMAP(DEF) keysym=%#x, seq='%s'\n",
-			      keysym, buf));
+			      (unsigned) keysym, buf));
 		}
 		return define_key(buf, keysym);
 	    } else {
@@ -1830,7 +1831,7 @@ static int LYgetch_for(int code)
     }
 #endif /* !USE_SLANG || VMS */
 
-    CTRACE((tfp, "GETCH%d: Got %#x.\n", code, c));
+    CTRACE((tfp, "GETCH%d: Got %#x.\n", code, (unsigned) c));
     if (LYNoZapKey > 1 && errno != EINTR &&
 	(c == EOF
 #ifdef USE_SLANG
@@ -6200,7 +6201,7 @@ int LYReadCmdKey(int mode)
 	ch = LYgetch_for(mode);
     }
     CTRACE((tfp, "LYReadCmdKey(%d) ->%s (%#x)\n",
-	    mode, LYKeycodeToString(ch, TRUE), ch));
+	    mode, LYKeycodeToString(ch, TRUE), (unsigned) ch));
     LYWriteCmdKey(ch);
     return ch;
 }
diff --git a/src/LYStructs.h b/src/LYStructs.h
index 70f2c063..179914ac 100644
--- a/src/LYStructs.h
+++ b/src/LYStructs.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYStructs.h,v 1.31 2013/10/03 08:56:47 tom Exp $
+ * $LynxId: LYStructs.h,v 1.32 2021/06/09 20:56:05 tom Exp $
  */
 #ifndef LYSTRUCTS_H
 #define LYSTRUCTS_H
@@ -86,7 +86,7 @@ extern "C" {
 
     extern HistInfo *history;
     extern int nhist;
-    extern int size_history;
+    extern unsigned size_history;
 
 /******************************************************************************/
 
diff --git a/src/LYStyle.c b/src/LYStyle.c
index c7aa52b3..77be1884 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYStyle.c,v 1.110 2019/09/06 09:00:48 tom Exp $
+ * $LynxId: LYStyle.c,v 1.111 2021/06/09 22:00:35 tom Exp $
  *
  * character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
@@ -238,7 +238,7 @@ static void parse_attributes(const char *mono,
 	int iBlink = !!((unsigned) cA & M_BLINK);
 
 	CTRACE2(TRACE_STYLE, (tfp, "parse_attributes %d/%d %d/%d %#x\n",
-			      fA, default_fg, bA, default_bg, cA));
+			      fA, default_fg, bA, default_bg, (unsigned) cA));
 	if (fA < MAX_COLOR
 	    && bA < MAX_COLOR
 #ifdef USE_CURSES_PAIR_0
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 752e9c0b..1378287d 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.298 2020/01/21 21:35:17 tom Exp $
+ * $LynxId: LYUtils.c,v 1.299 2021/06/09 21:46:53 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -6074,7 +6074,9 @@ FILE *LYOpenTemp(char *result,
 		make_it = TRUE;
 		CTRACE((tfp,
 			"lynx_temp_space is not our directory %s owner %d mode %03o\n",
-			lynx_temp_space, (int) sb.st_uid, (int) sb.st_mode & 0777));
+			lynx_temp_space,
+			(int) sb.st_uid,
+			(unsigned) (sb.st_mode & 0777)));
 	    }
 	} else {
 	    make_it = TRUE;
diff --git a/src/UCAuto.c b/src/UCAuto.c
index 19e043c0..2b17591e 100644
--- a/src/UCAuto.c
+++ b/src/UCAuto.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCAuto.c,v 1.55 2018/03/18 18:51:29 tom Exp $
+ * $LynxId: UCAuto.c,v 1.56 2021/06/09 22:29:43 tom Exp $
  *
  *  This file contains code for changing the Linux console mode.
  *  Currently some names for font files are hardwired in here.
@@ -173,7 +173,7 @@ static int call_setfont(const char *font,
 	FREE(T_setfont_cmd);
 	if (rv) {
 	    CTRACE((tfp, "call_setfont: system returned %d (0x%x)!\n",
-		    rv, rv));
+		    rv, (unsigned) rv));
 	    if (rv == -1 || WIFSIGNALED(rv) || !WIFEXITED(rv)) {
 		return -1;
 	    } else if ((WEXITSTATUS(rv) == EX_DATAERR ||
@@ -282,7 +282,8 @@ void UCChangeTerminalCodepage(int newcs,
 		CTRACE((tfp, "Restoring font: '%s'\n", tmpbuf1));
 		status = LYSystem(tmpbuf1);
 		if (status != 0) {
-		    CTRACE((tfp, "...system returned %d (0x%x)\n", status, status));
+		    CTRACE((tfp, "...system returned %d (0x%x)\n", status,
+			    (unsigned) status));
 		}
 		FREE(tmpbuf1);
 	    }
@@ -328,7 +329,7 @@ void UCChangeTerminalCodepage(int newcs,
 	    CTRACE((tfp, "Saving font: '%s'\n", tmpbuf1));
 	    rv = LYSystem(tmpbuf1);
 	    if (rv != 0) {
-		CTRACE((tfp, "...system returned %d (0x%x)\n", rv, rv));
+		CTRACE((tfp, "...system returned %d (0x%x)\n", rv, (unsigned) rv));
 	    }
 	    FREE(tmpbuf1);
 	    LYCloseTempFP(fp1);
diff --git a/src/UCAux.c b/src/UCAux.c
index fd3de5ff..5d7b70a4 100644
--- a/src/UCAux.c
+++ b/src/UCAux.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCAux.c,v 1.51 2016/04/17 22:18:15 tom Exp $
+ * $LynxId: UCAux.c,v 1.52 2021/06/09 22:29:39 tom Exp $
  */
 #include <HTUtils.h>
 
@@ -394,8 +394,8 @@ void UCSetBoxChars(int cset,
 				CTRACE((tfp,
 					"  map[%c] %#" PRI_UCode_t " -> %#x\n",
 					table[n].mapping,
-					table[n].internal,
-					table[n].external));
+					CAST_UCode_t (table[n].internal),
+					(unsigned)table[n].external));
 				break;
 			    }
 			}
@@ -419,7 +419,8 @@ void UCSetBoxChars(int cset,
 			CTRACE((tfp,
 				"line-drawing map %c mismatch (have %#x, want %#x)\n",
 				table[n].mapping,
-				test, table[n].external));
+				(unsigned) test,
+				(unsigned) table[n].external));
 			fix_lines = TRUE;
 			break;
 		    }
diff --git a/src/UCdomap.c b/src/UCdomap.c
index a01da5fd..31623e5a 100644
--- a/src/UCdomap.c
+++ b/src/UCdomap.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: UCdomap.c,v 1.105 2021/03/14 17:14:26 emil Exp $
+ * $LynxId: UCdomap.c,v 1.106 2021/06/09 22:29:08 tom Exp $
  *
  *  UCdomap.c
  *  =========
@@ -984,7 +984,7 @@ int UCTransUniCharStr(char *outbuf,
 		if ((pout - outbuf) == 3) {
 		    CTRACE((tfp,
 			    "It seems to be a JIS X 0201 code(%" PRI_UCode_t
-			    "). Not supported.\n", unicode));
+			    "). Not supported.\n", CAST_UCode_t (unicode)));
 		    pin = str;
 		    inleft = 2;
 		    pout = outbuf;
diff --git a/src/parsdate.c b/src/parsdate.c
index 17a6d8e2..a38f33c0 100644
--- a/src/parsdate.c
+++ b/src/parsdate.c
@@ -3,9 +3,9 @@
 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
 
 #define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define YYPATCH 20190617
+#define YYMAJOR 2
+#define YYMINOR 0
+#define YYPATCH 20210520
 
 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
@@ -22,7 +22,7 @@
 #include <LYLeaks.h>
 
 /*
- *  $LynxId: parsdate.c,v 1.28 2019/08/28 23:01:49 tom Exp $
+ *  $LynxId: parsdate.c,v 1.29 2021/06/08 23:03:24 tom Exp $
  *
  *  This module is adapted and extended from tin, to use for LYmktime().
  *
@@ -160,7 +160,7 @@ static void date_error(const char GCC_UNUSED *s)
 #ifndef YYSTYPE_IS_DECLARED
 #define YYSTYPE_IS_DECLARED 1
 #line 139 "./parsdate.y"
-typedef union {
+typedef union YYSTYPE {
     time_t		Number;
     enum _MERIDIAN	Meridian;
 } YYSTYPE;
@@ -213,7 +213,7 @@ extern int YYPARSE_DECL();
 #define tZONE 265
 #define tDST 266
 #define YYERRCODE 256
-typedef short YYINT;
+typedef int YYINT;
 static const YYINT yylhs[] = {                           -1,
     0,    0,    4,    4,    4,    4,    4,    4,    5,    5,
     5,    5,    5,    2,    2,    2,    2,    2,    1,    6,
@@ -929,6 +929,7 @@ static int GetTimeInfo(TIMEINFO * Now)
 #endif /* !defined(DONT_HAVE_TM_GMTOFF) */
 
     /* Get the basic time. */
+    memset(Now, 0, sizeof(TIMEINFO));
 #if defined(HAVE_GETTIMEOFDAY)
     if (gettimeofday(&tv, (struct timezone *) NULL) == -1)
 	return -1;
@@ -1048,7 +1049,7 @@ time_t parsedate(char *p,
      * from the error return value.  (Alternately could set errno on error.) */
     return (Start == BAD_TIME) ? 0 : Start;
 }
-#line 1052 "y.tab.c"
+#line 1053 "y.tab.c"
 
 #if YYDEBUG
 #include <stdio.h>	/* needed for printf */
@@ -1533,7 +1534,7 @@ case 35:
 	    yyval.Meridian = yystack.l_mark[0].Meridian;
 	}
 break;
-#line 1537 "y.tab.c"
+#line 1538 "y.tab.c"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
diff --git a/src/parsdate.y b/src/parsdate.y
index 282fa29b..d6655140 100644
--- a/src/parsdate.y
+++ b/src/parsdate.y
@@ -3,7 +3,7 @@
 #include <LYLeaks.h>
 
 /*
- *  $LynxId: parsdate.y,v 1.30 2019/08/28 23:00:39 tom Exp $
+ *  $LynxId: parsdate.y,v 1.31 2021/06/08 23:01:28 tom Exp $
  *
  *  This module is adapted and extended from tin, to use for LYmktime().
  *
@@ -869,6 +869,7 @@ static int GetTimeInfo(TIMEINFO * Now)
 #endif /* !defined(DONT_HAVE_TM_GMTOFF) */
 
     /* Get the basic time. */
+    memset(Now, 0, sizeof(TIMEINFO));
 #if defined(HAVE_GETTIMEOFDAY)
     if (gettimeofday(&tv, (struct timezone *) NULL) == -1)
 	return -1;