diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HTFWriter.c | 4 | ||||
-rw-r--r-- | src/LYEditmap.c | 3 | ||||
-rw-r--r-- | src/LYGCurses.h | 6 | ||||
-rw-r--r-- | src/LYKeymap.c | 3 | ||||
-rw-r--r-- | src/LYLeaks.c | 6 | ||||
-rw-r--r-- | src/LYLocal.c | 4 | ||||
-rw-r--r-- | src/LYStrings.c | 10 |
7 files changed, 20 insertions, 16 deletions
diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 49469764..de4c22eb 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFWriter.c,v 1.117 2018/12/25 23:14:16 tom Exp $ + * $LynxId: HTFWriter.c,v 1.118 2018/12/27 10:33:52 tom Exp $ * * FILE WRITER HTFWrite.h * =========== @@ -175,7 +175,7 @@ static void decompress_gzip(HTStream *me) LYCloseTempFP(fp); CTRACE((tfp, "...decompress %" PRI_off_t " to %lu\n", CAST_off_t (me->anchor->actual_length), - (unsigned long) actual)); + (unsigned long)actual)); if (success) { if (LYRenameFile(copied, in_name) == 0) me->anchor->actual_length = (off_t) actual; diff --git a/src/LYEditmap.c b/src/LYEditmap.c index 4124f596..dec2ac99 100644 --- a/src/LYEditmap.c +++ b/src/LYEditmap.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYEditmap.c,v 1.75 2018/03/10 01:31:27 tom Exp $ + * $LynxId: LYEditmap.c,v 1.76 2018/12/27 10:33:52 tom Exp $ * * LYEditMap.c * Keybindings for line and form editing. @@ -1732,6 +1732,7 @@ static void initLineEditor(LYEditConfig * table) const LYEditInit *init = table->init; memset(used, 0, sizeof(LYEditCode) * KEYMAP_SIZE); + for (k = 0; init[k].code >= 0; ++k) { int code = init[k].code; diff --git a/src/LYGCurses.h b/src/LYGCurses.h index bdb1e5ef..ce5303cb 100644 --- a/src/LYGCurses.h +++ b/src/LYGCurses.h @@ -194,13 +194,13 @@ extern "C" { #undef scanw #pragma STANDARD - int printw(char *format_spec,...); + int printw(char *format_spec, ...); - int wprintw(WINDOW * win, char *format_spec,...); + int wprintw(WINDOW * win, char *format_spec, ...); int wrefresh(WINDOW * win); - int wscanw(WINDOW * win, char *format_spec,...); + int wscanw(WINDOW * win, char *format_spec, ...); int scanw(char *fmt, int arg1); diff --git a/src/LYKeymap.c b/src/LYKeymap.c index b0595649..b8bad31f 100644 --- a/src/LYKeymap.c +++ b/src/LYKeymap.c @@ -1,4 +1,4 @@ -/* $LynxId: LYKeymap.c,v 1.119 2016/11/24 16:38:22 tom Exp $ */ +/* $LynxId: LYKeymap.c,v 1.120 2018/12/27 10:33:52 tom Exp $ */ #include <HTUtils.h> #include <LYUtils.h> #include <LYGlobalDefs.h> @@ -1516,6 +1516,7 @@ static void initKeyMap(LYEditConfig * table) const LYEditInit *init = table->init; memset(used, 0, sizeof(LYEditCode) * KEYMAP_SIZE); + for (k = 0; init[k].code >= 0; ++k) { int code = init[k].code; diff --git a/src/LYLeaks.c b/src/LYLeaks.c index 2f2de289..3e212760 100644 --- a/src/LYLeaks.c +++ b/src/LYLeaks.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYLeaks.c,v 1.41 2018/03/30 00:27:58 tom Exp $ + * $LynxId: LYLeaks.c,v 1.42 2018/12/27 10:33:52 tom Exp $ * * Copyright (c) 1994, University of Kansas, All Rights Reserved * (this file was rewritten twice - 1998/1999 and 2003/2004) @@ -1117,7 +1117,7 @@ static char *LYLeakSAVsprintf(char **dest, /* Note: the following may need updating if HTSprintf in HTString.c * is changed. - kw */ -static char *LYLeakHTSprintf(char **pstr, const char *fmt,...) +static char *LYLeakHTSprintf(char **pstr, const char *fmt, ...) { char *str; size_t inuse = 0; @@ -1136,7 +1136,7 @@ static char *LYLeakHTSprintf(char **pstr, const char *fmt,...) /* Note: the following may need updating if HTSprintf0 in HTString.c * is changed. - kw */ -static char *LYLeakHTSprintf0(char **pstr, const char *fmt,...) +static char *LYLeakHTSprintf0(char **pstr, const char *fmt, ...) { char *str; va_list ap; diff --git a/src/LYLocal.c b/src/LYLocal.c index fcecce15..2e14a526 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYLocal.c,v 1.131 2016/11/24 17:18:55 tom Exp $ + * $LynxId: LYLocal.c,v 1.132 2018/12/27 10:33:52 tom Exp $ * * Routines to manipulate the local filesystem. * Written by: Rick Mallett, Carleton University @@ -377,7 +377,7 @@ static BOOLEAN ok_localname(char *dst, const char *src) #define MAX_ARGC 10 -static char **make_argv(const char *command,...) +static char **make_argv(const char *command, ...) { static char *result[MAX_ARGC]; int argc = 0; diff --git a/src/LYStrings.c b/src/LYStrings.c index e1845bb1..3fb31faa 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1,4 +1,4 @@ -/* $LynxId: LYStrings.c,v 1.273 2018/05/04 23:29:29 tom Exp $ */ +/* $LynxId: LYStrings.c,v 1.275 2018/12/27 10:32:15 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <UCAux.h> @@ -3226,9 +3226,11 @@ int LYEditInsert(FieldEditor * edit, unsigned const char *s, } else utfbuf[0] = (char) ucode; } - StrNCpy(Buffer + off, utfbuf, l); - edited = 1; - off += l; + if ((size_t) (off + l) <= BufAlloc) { + memcpy(Buffer + off, utfbuf, (size_t) l); + edited = 1; + off += l; + } s++; } if (tail) |