diff options
author | Xiretza | 2021-09-24 14:20:35 +0200 |
---|---|---|
committer | Xiretza | 2021-09-24 14:20:35 +0200 |
commit | 4e5f142da3a78b2d4d2c7b72ef72cfefb9308f5d (patch) | |
tree | a6ffe72fc85d71464cd9ecb86f99b53be35cc34a | |
parent | 2b0083d82fa4437745d14409ba02fad150f68edf (diff) | |
download | aur-4e5f142da3a78b2d4d2c7b72ef72cfefb9308f5d.tar.gz |
Fix build with -Werror=format-security
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | 0001-Fix-compile-with-Werror-format-security.patch | 36 | ||||
-rw-r--r-- | PKGBUILD | 14 |
3 files changed, 50 insertions, 5 deletions
@@ -1,14 +1,15 @@ pkgbase = log4c pkgdesc = Logging FrameWork for C, as Log4j or Log4Cpp pkgver = 1.2.4 - pkgrel = 2 + pkgrel = 3 url = http://log4c.sourceforge.net/ arch = i686 arch = x86_64 license = LGPL depends = expat source = http://prdownloads.sourceforge.net/log4c/log4c-1.2.4.tar.gz + source = 0001-Fix-compile-with-Werror-format-security.patch sha256sums = 5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea + sha256sums = f85bdfa6525739569ddb1c1f4bbf90de399dc3c95b24b964c8773fa89d17e47f pkgname = log4c - diff --git a/0001-Fix-compile-with-Werror-format-security.patch b/0001-Fix-compile-with-Werror-format-security.patch new file mode 100644 index 000000000000..34bac8f2fa02 --- /dev/null +++ b/0001-Fix-compile-with-Werror-format-security.patch @@ -0,0 +1,36 @@ +From 7fb2aed4607ff31a89841ac1dded72f9817b0bcc Mon Sep 17 00:00:00 2001 +From: Xiretza <xiretza@xiretza.xyz> +Date: Fri, 24 Sep 2021 14:17:39 +0200 +Subject: [PATCH] Fix compile with -Werror=format-security +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In file included from helloworld1.c:8: +mylog.h: In function ‘mylog_msg’: +mylog.h:42:9: error: format not a string literal and no format arguments [-Werror=format-security] + 42 | log4c_category_log(log4c_category_get(catName), a_priority, msg); + | ^~~~~~~~~~~~~~~~~~ +--- + examples/helloworld1/mylog.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/examples/helloworld1/mylog.h b/examples/helloworld1/mylog.h +index 280f3dc..f8e0c81 100644 +--- a/examples/helloworld1/mylog.h ++++ b/examples/helloworld1/mylog.h +@@ -39,9 +39,9 @@ static LOG4C_INLINE int mylog_fini(){ + + static LOG4C_INLINE void mylog_msg(char *catName,int a_priority, char *msg){ + #ifndef WITHOUT_LOG4C +- log4c_category_log(log4c_category_get(catName), a_priority, msg); ++ log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg); + #else +- printf(msg); ++ printf("%s", msg); + #endif + } + +-- +2.33.0 + @@ -4,14 +4,22 @@ pkgname=log4c pkgver=1.2.4 -pkgrel=2 +pkgrel=3 pkgdesc='Logging FrameWork for C, as Log4j or Log4Cpp' url='http://log4c.sourceforge.net/' arch=('i686' 'x86_64') license=('LGPL') depends=('expat') -source=("http://prdownloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz") -sha256sums=('5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea') +source=("http://prdownloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz" + "0001-Fix-compile-with-Werror-format-security.patch") +sha256sums=('5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea' + 'f85bdfa6525739569ddb1c1f4bbf90de399dc3c95b24b964c8773fa89d17e47f') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + patch -p1 < "$srcdir/0001-Fix-compile-with-Werror-format-security.patch" +} build() { cd "$srcdir/$pkgname-$pkgver" |