From fa104b49108f0f17fa5d37e4073a35f00f3be6a8 Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Thu, 13 Jul 2023 18:39:24 +0800 Subject: [PATCH] fix build error --- Fix-compilation-failure-caused-by-gcc12.patch | 26 +++++++++++++++++++ esc.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Fix-compilation-failure-caused-by-gcc12.patch diff --git a/Fix-compilation-failure-caused-by-gcc12.patch b/Fix-compilation-failure-caused-by-gcc12.patch new file mode 100644 index 0000000..214fdf3 --- /dev/null +++ b/Fix-compilation-failure-caused-by-gcc12.patch @@ -0,0 +1,26 @@ +diff --git a/src/lib/coolkey/CoolKey_Message.cpp b/src/lib/coolkey/CoolKey_Message.cpp +index 87ee309..7b80f70 100644 +--- a/src/lib/coolkey/CoolKey_Message.cpp ++++ b/src/lib/coolkey/CoolKey_Message.cpp +@@ -213,7 +213,7 @@ void eCKMessage::setBinValue(string &aKey,unsigned char*aValue,int *aSize) + if(!aKey.length()) + return; + +- if(aSize <=0 || !aValue) ++ if(aSize ==0 || !aValue) + return; + + string data = ""; +diff --git a/src/lib/nss-http-client/request.cpp b/src/lib/nss-http-client/request.cpp +index cabd94f..5428350 100644 +--- a/src/lib/nss-http-client/request.cpp ++++ b/src/lib/nss-http-client/request.cpp +@@ -192,7 +192,7 @@ PRBool PSHttpRequest::setBody(int size, const char* body) { + } + + _bodyLength = size; +- sprintf(_body,body); ++ sprintf(_body,"%s",body); + //_body = (char *)body; + + return PR_TRUE; diff --git a/esc.spec b/esc.spec index c0a33fd..cb0a2b6 100644 --- a/esc.spec +++ b/esc.spec @@ -1,6 +1,6 @@ Name: esc Version: 1.1.2 -Release: 5 +Release: 6 Summary: esc embeds files into go programs and provides http License: GPL+ URL: https://github.com/mjibson/esc @@ -8,6 +8,7 @@ Source0: http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}.tar Source1: esc Source2: esc.desktop Source3: esc.png +Patch0: Fix-compilation-failure-caused-by-gcc12.patch BuildRequires: glib2-devel atk-devel pkgconfig nspr-devel nss-devel nss-static BuildRequires: pcsc-lite-devel desktop-file-utils dbus-glib-devel glib2-devel gcc-c++ @@ -86,6 +87,9 @@ echo "/usr/local/lib" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %defattr(-,root,root) %changelog +* Thu Jul 13 2023 liyanan - 1.1.2-6 +- fix build error + * Sat Jul 30 2022 yaoxin - 1.1.2-5 - Remove rpath - Add chrpath in BuildRequire