Control: tags 853441 + patch
Control: tags 853441 + pending
Dear maintainer,
I've prepared an NMU for hexcurse (versioned as 1.58-1.1) and uploaded
it to DELAYED/10. Please feel free to tell me if I should cancel it.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
diff -Nru hexcurse-1.58/debian/changelog hexcurse-1.58/debian/changelog
--- hexcurse-1.58/debian/changelog 2014-04-01 15:53:00.000000000 +0300
+++ hexcurse-1.58/debian/changelog 2017-08-17 20:32:55.000000000 +0300
@@ -1,3 +1,11 @@
+hexcurse (1.58-1.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Add patches from Felix Gruber to fix FTBFS with gcc 7.
+ (Closes: #853441)
+
+ -- Adrian Bunk <[email protected]> Thu, 17 Aug 2017 20:32:55 +0300
+
hexcurse (1.58-1) unstable; urgency=low
* New upstream vesion 1.58-1 from https://github.com/LonnyGomes/hexcurse
diff -Nru hexcurse-1.58/debian/patches/0001-explicitly-mark-fallthrough-case.patch hexcurse-1.58/debian/patches/0001-explicitly-mark-fallthrough-case.patch
--- hexcurse-1.58/debian/patches/0001-explicitly-mark-fallthrough-case.patch 1970-01-01 02:00:00.000000000 +0200
+++ hexcurse-1.58/debian/patches/0001-explicitly-mark-fallthrough-case.patch 2017-08-17 20:32:14.000000000 +0300
@@ -0,0 +1,26 @@
+From d808cb7067d1df067f8b707fabbfaf9f8931484c Mon Sep 17 00:00:00 2001
+From: Felix Gruber <[email protected]>
+Date: Fri, 5 May 2017 22:40:07 +0200
+Subject: explicitly mark fallthrough case
+
+This prevents another error that got introduced with the more thorough
+diagnostics in GCC-7.
+---
+ src/acceptch.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/acceptch.c b/src/acceptch.c
+index 1580645..d57207b 100644
+--- a/src/acceptch.c
++++ b/src/acceptch.c
+@@ -297,6 +297,7 @@ int wacceptch(WINS *win, off_t len)
+ }
+ else
+ currentLine -= (2*MAXY);
++ /* fall through */
+
+ case CTRL_AND('d'):
+ case KEY_PGDN: /* if KEY_PGDN... */
+--
+2.11.0
+
diff -Nru hexcurse-1.58/debian/patches/0001-fix-format-truncation-error-with-GCC-7.patch hexcurse-1.58/debian/patches/0001-fix-format-truncation-error-with-GCC-7.patch
--- hexcurse-1.58/debian/patches/0001-fix-format-truncation-error-with-GCC-7.patch 1970-01-01 02:00:00.000000000 +0200
+++ hexcurse-1.58/debian/patches/0001-fix-format-truncation-error-with-GCC-7.patch 2017-08-17 20:32:55.000000000 +0300
@@ -0,0 +1,37 @@
+From 716b5d58ac859cc240b8ccb9cbd79ace3e0593c1 Mon Sep 17 00:00:00 2001
+From: Felix Gruber <[email protected]>
+Date: Fri, 5 May 2017 22:20:00 +0200
+Subject: fix format truncation error with GCC-7
+
+GCC-7 introduced new warnings and errors. Among them is a new warning
+for possible truncations in the output of snprintf. Since we are only
+interested in the return value of snprintf and do not use the string
+written by it we can also replace the buffer with a NULL pointer.
+This makes it explicit that we do not want to write a string and
+silences the GCC-7 error.
+
+See also the examples in
+http://en.cppreference.com/w/c/io/fprintf
+---
+ src/hexcurse.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/hexcurse.c b/src/hexcurse.c
+index 9342eb5..e723ddc 100644
+--- a/src/hexcurse.c
++++ b/src/hexcurse.c
+@@ -235,10 +235,9 @@ off_t parseArgs(int argc, char *argv[])
+ \********************************************************/
+ int getMinimumAddressLength(off_t len)
+ {
+- char buffer[1];
+ int min_address_length;
+
+- min_address_length = snprintf(buffer, 1, "%jd", (intmax_t)len);
++ min_address_length = snprintf(NULL, 0, "%jd", (intmax_t)len);
+
+ /* At least 8 characters wide */
+ return min_address_length > 8 ? min_address_length : 8;
+--
+2.11.0
+
diff -Nru hexcurse-1.58/debian/patches/series hexcurse-1.58/debian/patches/series
--- hexcurse-1.58/debian/patches/series 2014-04-01 15:52:40.000000000 +0300
+++ hexcurse-1.58/debian/patches/series 2017-08-17 20:32:55.000000000 +0300
@@ -1,2 +1,4 @@
0001-Dont-ignore-singals.patch
0002-Manpage-fix.patch
+0001-explicitly-mark-fallthrough-case.patch
+0001-fix-format-truncation-error-with-GCC-7.patch