--- /dev/null
+gcc's -Werror=stringop-truncation tries to be too smart, but actually it isn't.
+Take len just after initialization, before call to mkstemp() (which doesn't change string length);
+now gcc doesn't complain.
+
+--- pinfo-0.6.13/src/utils.c.orig 2019-02-16 21:23:32.000000000 +0100
++++ pinfo-0.6.13/src/utils.c 2021-10-03 07:45:00.428038370 +0200
+@@ -848,10 +848,10 @@ char *
+ make_tempfile()
+ {
+ char *filename;
+- size_t len;
+
+ /* TODO: fix hardcoded /tmp */
+ char tmpfile_template[] = "/tmp/pinfo.XXXXXX";
++ size_t len = strlen(tmpfile_template)+1;
+
+ /* create a tmpfile */
+ int fd = mkstemp(tmpfile_template);
+@@ -864,7 +864,6 @@ make_tempfile()
+ }
+
+ /* allocate a new string and copy the filename there */
+- len = strlen(tmpfile_template)+1;
+ filename = xmalloc(len+1); /* guarenteerd to be set to \0's */
+ strncpy(filename, tmpfile_template, len);
+
Summary(uk.UTF-8): Програма перегляду info- та man-документів у стилі lynx
Name: pinfo
Version: 0.6.13
-Release: 1
+Release: 2
License: GPL v2
Group: Applications/System
#Source0Download: https://github.com/baszoetekouw/pinfo/releases
Patch4: %{name}-gettext.patch
Patch5: %{name}-color.patch
Patch6: %{name}-no-common.patch
+Patch7: %{name}-truncation-workaround.patch
URL: https://github.com/baszoetekouw/pinfo
BuildRequires: autoconf >= 2.57
BuildRequires: automake
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
%build
CPPFLAGS="-I%{_includedir}/ncursesw"