From 9059116fa26be3afb290c2c7e6d18294f6a55367 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Dec 07 2022 07:26:01 +0000 Subject: Add missing declaration of strlcpy for C99 compatibility (#2151452) Related to: --- diff --git a/cpdup-c99.patch b/cpdup-c99.patch new file mode 100644 index 0000000..cf53501 --- /dev/null +++ b/cpdup-c99.patch @@ -0,0 +1,17 @@ +Declare strlcpy to avoid an implicit function declaration in +hc_readdir in hcproto.c. This improves compatibility with future +compilers which might not accept implicit function declarations by +default. + +diff --git a/cpdup.h b/cpdup.h +index 4843f8f98c8c2c52..67b81b9b56975c57 100644 +--- a/cpdup.h ++++ b/cpdup.h +@@ -40,6 +40,7 @@ + #define __printf0like(a,b) + #define __aligned(x) + #define __unused ++size_t strlcpy(char *dst, const char *src, size_t size); + #endif + + void logstd(const char *ctl, ...) __printflike(1, 2); diff --git a/cpdup.spec b/cpdup.spec index dd51e3e..6fe500e 100644 --- a/cpdup.spec +++ b/cpdup.spec @@ -1,6 +1,6 @@ Name: cpdup Version: 1.18 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Filesystem mirroring utility %if 0%{?el5} @@ -9,6 +9,7 @@ License: BSD URL: http://apollo.backplane.com/FreeSrc/ Source0: http://apollo.backplane.com/FreeSrc/cpdup-%{version}.tgz Source1: Makefile.linux +Patch0: cpdup-c99.patch BuildRequires: gcc BuildRequires: make @@ -27,7 +28,7 @@ destination directory with a file. %prep -%autosetup -n %{name} +%autosetup -p1 -n %{name} # we don't want this to get compiled mv md5.c{,.off} # make scripts non-executable for cleanliness @@ -51,6 +52,9 @@ make install DESTDIR=$RPM_BUILD_ROOT -f %{SOURCE1} %changelog +* Wed Dec 7 2022 Florian Weimer - 1.18-13 +- Add missing declaration of strlcpy for C99 compatibility (#2151452) + * Wed Jul 20 2022 Fedora Release Engineering - 1.18-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild