Control: tags -1 + patch

Am 13.09.2021 um 09:30 schrieb Helmut Grohne:

> Source: hexcurse
> Version: 1.58-1.3
> Severity: serious
> Tags: ftbfs
>
> hexcurse fails to build from source in unstable. A build ends as
> follows:
>
> | gcc -DHAVE_CONFIG_H -I. -I..  -I../include -Wall -Werror -Wextra
> | -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
> | -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong
> | -Wformat -Werror=format-security -c screen.c
> | screen.c: In function ‘popupWin’:
> | screen.c:490:5: error: format not a string literal and no format arguments 
> [-Werror=format-security]
> |   490 |     mvwprintw(tmpwin,2,3, msg);    /* output mesg        */
> |       |     ^~~~~~~~~
> | screen.c: In function ‘questionWin’:
> | screen.c:531:5: error: format not a string literal and no format arguments 
> [-Werror=format-security]
> |   531 |     mvwprintw(tmpwin,2,3, msg);
> |       |     ^~~~~~~~~
> | cc1: all warnings being treated as errors
> | make[3]: *** [Makefile:258: screen.o] Error 1
> | make[3]: Leaving directory '/<<PKGBUILDDIR>>/src'
> | make[2]: *** [Makefile:266: all-recursive] Error 1
> | make[2]: Leaving directory '/<<PKGBUILDDIR>>'
> | make[1]: *** [Makefile:206: all] Error 2
> | make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> | dh_auto_build: error: make -j1 returned exit code 2
> | make: *** [debian/rules:4: build] Error 25
> | dpkg-buildpackage: error: debian/rules build subprocess returned exit 
> status 2

The attached patch which could be dropped into debian/patches fixes that
by adding "%s" as penultimate argument in the two mvwprintw calls above.
See #993179 for the change in ncurses which triggered these errors.

From 9dec70d033da420ffe77251fc662d9703bf4389e Mon Sep 17 00:00:00 2001
From: Sven Joachim <svenj...@gmx.de>
Date: Wed, 13 Oct 2021 17:46:54 +0200
Subject: [PATCH] Fix string format errors with recent ncurses

---
 src/screen.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 5172ccf..f54978b 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -487,7 +487,7 @@ void popupWin(char *msg, int time)

     keypad(tmpwin, TRUE);

-    mvwprintw(tmpwin,2,3, msg);				/* output mesg        */
+    mvwprintw(tmpwin,2,3, "%s", msg);				/* output mesg        */
     wmove(tmpwin,2,len+4);
     wrefresh(tmpwin);

@@ -528,7 +528,7 @@ short int questionWin(char *msg)

     tmpwin = drawbox(y, x, 5, len + 6);			/* create window      */

-    mvwprintw(tmpwin,2,3, msg);
+    mvwprintw(tmpwin,2,3, "%s", msg);
     wmove(tmpwin,2,len+4);
     wrefresh(tmpwin);

--
2.33.0

Reply via email to