pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/w3m www/w3m: fix -Wchar-subscripts



details:   https://anonhg.NetBSD.org/pkgsrc/rev/de2d888c85c0
branches:  trunk
changeset: 426169:de2d888c85c0
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Mar 27 06:19:47 2020 +0000

description:
www/w3m: fix -Wchar-subscripts

diffstat:

 www/w3m/distinfo             |   3 ++-
 www/w3m/patches/patch-main.c |  29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r b3d9e0dbf21c -r de2d888c85c0 www/w3m/distinfo
--- a/www/w3m/distinfo  Fri Mar 27 06:08:58 2020 +0000
+++ b/www/w3m/distinfo  Fri Mar 27 06:19:47 2020 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.32 2020/03/12 18:22:54 wiz Exp $
+$NetBSD: distinfo,v 1.33 2020/03/27 06:19:47 rillig Exp $
 
 SHA1 (w3m-0.5.3+git20190105.tar.gz) = 47d315af8e4a34f0d726687295e5d448a809acdc
 RMD160 (w3m-0.5.3+git20190105.tar.gz) = d71cd692d9ce166c8a1fd3e3c7203f0a37cd5158
 SHA512 (w3m-0.5.3+git20190105.tar.gz) = b63b15d0bea82f50bcaa9fc0826c2d3c265a3ad73069b4a020812f28b552cdf08618ab877280c9f3a43bd64f51b80b7a526098e6395ea121c0981a3fcd2562b4
 Size (w3m-0.5.3+git20190105.tar.gz) = 2183651 bytes
+SHA1 (patch-main.c) = ac422d68d399eec6339d8eb24a4f85991ef58208
diff -r b3d9e0dbf21c -r de2d888c85c0 www/w3m/patches/patch-main.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/w3m/patches/patch-main.c      Fri Mar 27 06:19:47 2020 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-main.c,v 1.1 2020/03/27 06:19:47 rillig Exp $
+
+main.c:1225:29: error: array subscript has type 'char' [-Werror=char-subscripts]
+   (prec_num || (GlobalKeymap[c] == FUNCNAME_nulcmd))) {
+                             ^
+
+The variable c is used for reading characters via getc(), without
+checking for EOF. And yes, the declaration of that variable is indeed
+more than 800 lines away from its first use, even though the use is
+constrained to a single tiny block of code.
+
+The code is safe though since line 1225 above is only reached for
+'0' to '9'.
+
+https://sourceforge.net/p/w3m/patches/76/
+
+--- main.c.orig        2019-01-05 08:41:27.000000000 +0000
++++ main.c
+@@ -395,8 +395,8 @@ int
+ main(int argc, char **argv, char **envp)
+ {
+     Buffer *newbuf = NULL;
+-    char *p, c;
+-    int i;
++    char *p;
++    int c, i;
+     InputStream redin;
+     char *line_str = NULL;
+     char **load_argv;



Home | Main Index | Thread Index | Old Index