From 0586fc36fc7d6fce391ee536faae033440a12daa Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Feb 15 2017 09:26:22 +0000 Subject: fix gcc 7 format-truncation error --- diff --git a/memcached-1.4.34-gcc7fmt.patch b/memcached-1.4.34-gcc7fmt.patch new file mode 100644 index 0000000..4aeea56 --- /dev/null +++ b/memcached-1.4.34-gcc7fmt.patch @@ -0,0 +1,15 @@ + +gcc -Wformat-truncation thinks this might truncate. + +diff -uap memcached-1.4.34/util.c.gcc7fmt memcached-1.4.34/util.c +--- memcached-1.4.34/util.c.gcc7fmt ++++ memcached-1.4.34/util.c +@@ -18,7 +18,7 @@ + if (isalnum(x) || x == '-' || x == '.' || x == '_' || x == '~') { + uriencode_map[x] = NULL; + } else { +- snprintf(str, 4, "%%%02X", x); ++ snprintf(str, 4, "%%%02hhX", (unsigned char)x); + uriencode_map[x] = str; + str += 3; /* lobbing off the \0 is fine */ + } diff --git a/memcached.spec b/memcached.spec index c8b90aa..cf82d10 100644 --- a/memcached.spec +++ b/memcached.spec @@ -4,7 +4,7 @@ Name: memcached Version: 1.4.34 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 0 Summary: High Performance, Distributed Memory Object Cache @@ -15,6 +15,7 @@ Source0: http://www.memcached.org/files/%{name}-%{version}.tar.gz Source1: memcached.sysconfig Patch1: memcached-unit.patch +Patch2: memcached-1.4.34-gcc7fmt.patch BuildRequires: libevent-devel systemd-units BuildRequires: perl-generators @@ -43,6 +44,7 @@ access to the memcached binary include files. %prep %setup -q %patch1 -p1 -b .unit +%patch2 -p1 -b .gcc7fmt %build # compile with full RELRO @@ -121,6 +123,9 @@ exit 0 %{_includedir}/memcached/* %changelog +* Wed Feb 15 2017 Joe Orton - 0:1.4.34-3 +- fix gcc 7 format-truncation error + * Fri Feb 10 2017 Fedora Release Engineering - 0:1.4.34-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild