diff options
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTFTP.c | 14 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTString.c | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTString.h | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTVMS_WaisUI.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTVMS_WaisUI.h | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/LYLeaks.h | 4 | ||||
-rw-r--r-- | WWW/Library/Implementation/dtd_util.c | 6 | ||||
-rw-r--r-- | WWW/Library/Implementation/www_tcp.h | 17 | ||||
-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 |
17 files changed, 64 insertions, 52 deletions
diff --git a/CHANGES b/CHANGES index 56258cd2..afefe1e5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@ --- $LynxId: CHANGES,v 1.992 2018/12/25 21:27:01 tom Exp $ +-- $LynxId: CHANGES,v 1.993 2018/12/26 12:19:54 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== -2018-12-25 (2.9.0dev.1) +2018-12-26 (2.9.0dev.1) +* compiler-warning fixes for gcc8 and VS2015 -TD * fix overlooked "2.8.9" in README -Larry Hynes 2018-07-08 (2.8.9rel.1) diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c index dbe278f6..a993762a 100644 --- a/WWW/Library/Implementation/HTFTP.c +++ b/WWW/Library/Implementation/HTFTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFTP.c,v 1.137 2018/05/16 19:36:44 tom Exp $ + * $LynxId: HTFTP.c,v 1.140 2018/12/27 10:24:31 tom Exp $ * * File Transfer Protocol (FTP) Client * for a WorldWideWeb browser @@ -233,11 +233,11 @@ static PortNumber port_number = FIRST_TCP_PORT; #endif /* POLL_PORTS */ static BOOL have_socket = FALSE; /* true if master_socket is valid */ -static unsigned master_socket; /* Listening socket = invalid */ +static LYNX_FD master_socket; /* Listening socket = invalid */ static char port_command[255]; /* Command for setting the port */ static fd_set open_sockets; /* Mask of active channels */ -static unsigned num_sockets; /* Number of sockets to scan */ +static LYNX_FD num_sockets; /* Number of sockets to scan */ static PortNumber passive_port; /* Port server specified for data */ #define NEXT_CHAR HTGetCharacter() /* Use function in HTFormat.c */ @@ -1113,7 +1113,7 @@ static void set_master_socket(int value) { have_socket = (BOOLEAN) (value >= 0); if (have_socket) - master_socket = (unsigned) value; + master_socket = (LYNX_FD) value; } /* Close Master (listening) socket @@ -1129,7 +1129,7 @@ static int close_master_socket(void) FD_CLR(master_socket, &open_sockets); status = NETCLOSE((int) master_socket); - CTRACE((tfp, "HTFTP: Closed master socket %u\n", master_socket)); + CTRACE((tfp, "HTFTP: Closed master socket %u\n", (unsigned) master_socket)); reset_master_socket(); @@ -1422,7 +1422,7 @@ static void set_years_and_date(void) } } i++; - sprintf(date, "9999%02d%.2s", i, day); + sprintf(date, "9999%02d%.2s", i % 100, day); TheDate = atoi(date); LYStrNCpy(ThisYear, printable + 20, 4); sprintf(LastYear, "%d", (atoi(ThisYear) - 1) % 10000); @@ -2586,7 +2586,7 @@ static void formatDate(char target[16], EntryInfo *entry) } } i++; - sprintf(month, "%02d", i); + sprintf(month, "%02d", i % 100); strcat(target, month); StrNCat(target, &entry->date[4], 2); if (target[6] == ' ' || target[6] == HT_NON_BREAK_SPACE) { diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c index 4a1ab43a..54d8207e 100644 --- a/WWW/Library/Implementation/HTString.c +++ b/WWW/Library/Implementation/HTString.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTString.c,v 1.74 2018/02/15 01:54:27 tom Exp $ + * $LynxId: HTString.c,v 1.75 2018/12/27 10:28:12 tom Exp $ * * Case-independent string comparison HTString.c * @@ -897,7 +897,7 @@ PUBLIC_IF_FIND_LEAKS char *StrAllocVsprintf(char **pstr, #ifdef HTSprintf /* if hidden by LYLeaks stuff */ #undef HTSprintf #endif -char *HTSprintf(char **pstr, const char *fmt,...) +char *HTSprintf(char **pstr, const char *fmt, ...) { char *result = 0; size_t inuse = 0; @@ -924,7 +924,7 @@ char *HTSprintf(char **pstr, const char *fmt,...) #ifdef HTSprintf0 /* if hidden by LYLeaks stuff */ #undef HTSprintf0 #endif -char *HTSprintf0(char **pstr, const char *fmt,...) +char *HTSprintf0(char **pstr, const char *fmt, ...) { char *result = 0; va_list ap; @@ -1330,7 +1330,7 @@ void HTSABFree(bstring **ptr) * Use this function to perform formatted sprintf's onto the end of a bstring. * The bstring may contain embedded nulls; the formatted portions must not. */ -bstring *HTBprintf(bstring **pstr, const char *fmt,...) +bstring *HTBprintf(bstring **pstr, const char *fmt, ...) { bstring *result = 0; char *temp = 0; diff --git a/WWW/Library/Implementation/HTString.h b/WWW/Library/Implementation/HTString.h index a5ff20dc..e5ab99e8 100644 --- a/WWW/Library/Implementation/HTString.h +++ b/WWW/Library/Implementation/HTString.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTString.h,v 1.39 2018/05/11 22:36:34 tom Exp $ + * $LynxId: HTString.h,v 1.40 2018/12/27 10:27:01 tom Exp $ * String handling for libwww * STRINGS * @@ -90,8 +90,8 @@ extern "C" { extern char *HTNextTok(char **pstr, const char *delims, const char *bracks, char *found); - extern char *HTSprintf(char **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3); - extern char *HTSprintf0(char **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3); + extern char *HTSprintf(char **pstr, const char *fmt, ...) GCC_PRINTFLIKE(2,3); + extern char *HTSprintf0(char **pstr, const char *fmt, ...) GCC_PRINTFLIKE(2,3); #if defined(LY_FIND_LEAKS) /* private otherwise */ extern char *StrAllocVsprintf(char **pstr, @@ -156,7 +156,7 @@ extern "C" { #define BStrCat0(d,s) HTSABCat0( &(d), s) #define BStrFree(d) HTSABFree( &(d)) - extern bstring *HTBprintf(bstring **pstr, const char *fmt,...) GCC_PRINTFLIKE(2,3); + extern bstring *HTBprintf(bstring **pstr, const char *fmt, ...) GCC_PRINTFLIKE(2,3); extern void trace_bstring(bstring *data); extern void trace_bstring2(const char *text, int size); diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 4669efd4..de5b02c5 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTCP.c,v 1.149 2018/05/16 19:48:49 tom Exp $ + * $LynxId: HTTCP.c,v 1.151 2018/12/26 13:16:59 tom Exp $ * * Generic Communication Code HTTCP.c * ========================== @@ -1288,7 +1288,7 @@ BOOLEAN LYCheckHostByName(char *host) * field is left unchanged in *soc_in. */ #ifndef INET6 -static int HTParseInet(SockA * soc_in, const char *str) +static int HTParseInet(SockA *soc_in, const char *str) { static const char *this_func = "HTParseInet"; @@ -2015,7 +2015,7 @@ int HTDoConnect(const char *url, } set_timeout(&select_timeout); FD_ZERO(&writefds); - FD_SET((unsigned) *s, &writefds); + FD_SET((LYNX_FD) *s, &writefds); #ifdef SOCKS if (socks_flag) ret = Rselect(*s + 1, NULL, @@ -2292,7 +2292,7 @@ int HTDoRead(int fildes, do { set_timeout(&select_timeout); FD_ZERO(&readfds); - FD_SET((unsigned) fildes, &readfds); + FD_SET((LYNX_FD) fildes, &readfds); #ifdef SOCKS if (socks_flag) ret = Rselect(fildes + 1, diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.c b/WWW/Library/Implementation/HTVMS_WaisUI.c index 6e127517..e74ab0ae 100644 --- a/WWW/Library/Implementation/HTVMS_WaisUI.c +++ b/WWW/Library/Implementation/HTVMS_WaisUI.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTVMS_WaisUI.c,v 1.19 2013/05/03 20:51:49 tom Exp $ + * $LynxId: HTVMS_WaisUI.c,v 1.20 2018/12/27 10:28:12 tom Exp $ * HTVMS_WAISUI.c * * Adaptation for Lynx by F.Macrides (macrides@sci.wfeb.edu) @@ -1484,7 +1484,7 @@ long anyToLong(any *a) #define bitsPerByte 8 -bit_map *makeBitMap(unsigned long numBits,...) +bit_map *makeBitMap(unsigned long numBits, ...) /* construct and return a bitmap with numBits elements */ { va_list ap; @@ -2127,7 +2127,7 @@ static void exitAction(long error GCC_UNUSED) #define PANIC_HEADER "Fatal Error: " -void panic(char *format,...) +void panic(char *format, ...) { va_list ap; /* the variable arguments */ diff --git a/WWW/Library/Implementation/HTVMS_WaisUI.h b/WWW/Library/Implementation/HTVMS_WaisUI.h index a2b2d07f..6ab702d6 100644 --- a/WWW/Library/Implementation/HTVMS_WaisUI.h +++ b/WWW/Library/Implementation/HTVMS_WaisUI.h @@ -22,7 +22,7 @@ extern "C" { * *----------------------------------------------------------------------*/ - void panic(char *format,...); + void panic(char *format, ...); /*----------------------------------------------------------------------*/ @@ -310,7 +310,7 @@ extern "C" { char *writeString(char *s, data_tag tag, char *buffer, long *len); char *readString(char **s, char *buffer); - bit_map *makeBitMap(unsigned long numBits,...); + bit_map *makeBitMap(unsigned long numBits, ...); void freeBitMap(bit_map *bm); boolean bitAtPos(unsigned long pos, bit_map *bm); diff --git a/WWW/Library/Implementation/LYLeaks.h b/WWW/Library/Implementation/LYLeaks.h index e75fd6da..2139fa38 100644 --- a/WWW/Library/Implementation/LYLeaks.h +++ b/WWW/Library/Implementation/LYLeaks.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYLeaks.h,v 1.17 2018/03/30 00:35:10 tom Exp $ + * $LynxId: LYLeaks.h,v 1.18 2018/12/27 10:27:01 tom Exp $ */ #ifndef __LYLEAKS_H /* @@ -296,7 +296,7 @@ extern "C" { * Trick to get tracking of var arg functions without relying on var arg * preprocessor macros: */ - typedef char *HTSprintflike(char **, const char *,...); + typedef char *HTSprintflike(char **, const char *, ...); extern HTSprintflike *Get_htsprintf_fn(const char *cp_File, const short ssi_Line); extern HTSprintflike *Get_htsprintf0_fn(const char *cp_File, diff --git a/WWW/Library/Implementation/dtd_util.c b/WWW/Library/Implementation/dtd_util.c index 0badcbd5..3301d819 100644 --- a/WWW/Library/Implementation/dtd_util.c +++ b/WWW/Library/Implementation/dtd_util.c @@ -1,5 +1,5 @@ /* - * $LynxId: dtd_util.c,v 1.78 2015/12/13 23:22:17 tom Exp $ + * $LynxId: dtd_util.c,v 1.79 2018/12/27 10:28:12 tom Exp $ * * Given a SGML_dtd structure, write a corresponding flat file, or "C" source. * Given the flat-file, write the "C" source. @@ -177,9 +177,9 @@ static SGMLContent s2SGMLContent(const char *value) return result; } -static void PrintF(FILE *, int, const char *,...) GCC_PRINTFLIKE(3, 4); +static void PrintF(FILE *, int, const char *, ...) GCC_PRINTFLIKE(3, 4); -static void PrintF(FILE *output, int width, const char *fmt,...) +static void PrintF(FILE *output, int width, const char *fmt, ...) { char buffer[BUFSIZ]; va_list ap; diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h index 8a081a5a..ef754c82 100644 --- a/WWW/Library/Implementation/www_tcp.h +++ b/WWW/Library/Implementation/www_tcp.h @@ -1,5 +1,5 @@ /* System dependencies in the W3 library - * $LynxId: www_tcp.h,v 1.59 2018/05/16 20:31:43 tom Exp $ + * $LynxId: www_tcp.h,v 1.61 2018/12/26 12:30:14 tom Exp $ * SYSTEM DEPENDENCIES @@ -313,7 +313,14 @@ extern int ws_netread(int fd, char *buf, int len); #define INCLUDES_DONE #define TCP_INCLUDES_DONE -#endif /* WINDOWS */ + +#define LYNX_FD SOCKET /* WINSOCK uses an unsigned value for FD_SET, etc */ + +#else + +#define LYNX_FD int /* POSIX says FD_SET descriptor is int */ + +#endif /* WINDOWS */ /* @@ -343,7 +350,7 @@ VAX/VMS #ifdef UCX #undef IOCTL #define IOCTL(s,cmd,arg) HTioctl(s,cmd,arg) -#endif /* UCX */ +#endif /* UCX */ #ifdef WIN_TCP #undef SOCKET_READ @@ -355,7 +362,7 @@ VAX/VMS #undef IOCTL #define IOCTL(a,b,c) -1 /* disables ioctl function */ #define NO_IOCTL /* flag to check if ioctl is disabled */ -#endif /* WIN_TCP */ +#endif /* WIN_TCP */ #ifdef CMU_TCP #undef SOCKET_READ @@ -366,7 +373,7 @@ VAX/VMS #define NETREAD(s,b,l) (cmu_get_sdc((s)) != 0 ? HTDoRead((s),(b),(l)) : read((s),(b),(l))) #define NETWRITE(s,b,l) (cmu_get_sdc((s)) != 0 ? cmu_write((s),(b),(l)) : write((s),(b),(l))) #define NETCLOSE(s) (cmu_get_sdc((s)) != 0 ? cmu_close((s)) : close((s))) -#endif /* CMU_TCP */ +#endif /* CMU_TCP */ #ifdef MULTINET #undef NETCLOSE 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) |