diff mbox series

[oe,meta-oe,3/5] opensc: Fix misaligned indentation

Message ID 20191228080740.63169-3-raj.khem@gmail.com
State Accepted
Commit bbb5732a4f96c754a864f2e306f3df69df621660
Headers show
Series [oe,meta-oe,1/5] jsoncpp: Upgrade to 1.9.2 | expand

Commit Message

Khem Raj Dec. 28, 2019, 8:07 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...0001-Fix-misleading-code-indentation.patch | 69 +++++++++++++++++++
 .../recipes-support/opensc/opensc_0.19.0.bb   |  1 +
 2 files changed, 70 insertions(+)
 create mode 100644 meta-oe/recipes-support/opensc/opensc/0001-Fix-misleading-code-indentation.patch

-- 
2.24.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/opensc/opensc/0001-Fix-misleading-code-indentation.patch b/meta-oe/recipes-support/opensc/opensc/0001-Fix-misleading-code-indentation.patch
new file mode 100644
index 0000000000..eb71b9d766
--- /dev/null
+++ b/meta-oe/recipes-support/opensc/opensc/0001-Fix-misleading-code-indentation.patch
@@ -0,0 +1,69 @@ 
+From 283578519ec83a8792b026c10322789784d629de Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 27 Dec 2019 11:33:57 -0800
+Subject: [PATCH] Fix misleading code indentation
+
+Fixes
+error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
+         if(cipher)
+         ^
+../../../git/src/libopensc/card-entersafe.c:369:2: note: previous statement is here
+        if(sbuf)
+        ^
+Upstream-Status: Submitted [https://github.com/OpenSC/OpenSC/pull/1894]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/libopensc/card-entersafe.c | 12 ++++++------
+ src/tools/pkcs15-init.c        |  4 ++--
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/libopensc/card-entersafe.c b/src/libopensc/card-entersafe.c
+index 3e42c11f..abb9fd81 100644
+--- a/src/libopensc/card-entersafe.c
++++ b/src/libopensc/card-entersafe.c
+@@ -352,10 +352,10 @@ static int entersafe_transmit_apdu(sc_card_t *card, sc_apdu_t *apdu,
+ 	 size_t cipher_data_size,mac_data_size;
+ 	 int blocks;
+ 	 int r=SC_SUCCESS;
+-	u8 *sbuf=NULL;
+-	size_t ssize=0;
++	 u8 *sbuf=NULL;
++	 size_t ssize=0;
+ 
+-	SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
++	 SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_VERBOSE);
+ 
+ 	 assert(card);
+ 	 assert(apdu);
+@@ -363,10 +363,10 @@ static int entersafe_transmit_apdu(sc_card_t *card, sc_apdu_t *apdu,
+ 	 if((cipher||mac) && (!key||(keylen!=8 && keylen!=16)))
+ 		  SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_VERBOSE, SC_ERROR_INVALID_ARGUMENTS);
+ 
+-	r = sc_apdu_get_octets(card->ctx, apdu, &sbuf, &ssize, SC_PROTO_RAW);
+-	if (r == SC_SUCCESS)
++	 r = sc_apdu_get_octets(card->ctx, apdu, &sbuf, &ssize, SC_PROTO_RAW);
++	 if (r == SC_SUCCESS)
+ 		sc_apdu_log(card->ctx, SC_LOG_DEBUG_VERBOSE, sbuf, ssize, 1);
+-	if(sbuf)
++	 if(sbuf)
+ 		free(sbuf);
+ 
+ 	 if(cipher)
+diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c
+index 1ce79f45..9a73121c 100644
+--- a/src/tools/pkcs15-init.c
++++ b/src/tools/pkcs15-init.c
+@@ -2311,8 +2311,8 @@ do_read_private_key(const char *filename, const char *format,
+ 			r = util_getpass(&passphrase, &len, stdin);
+ 			if (r < 0 || !passphrase)
+ 				return SC_ERROR_INTERNAL;
+- 			r = do_read_pkcs12_private_key(filename,
+- 					passphrase, pk, certs, max_certs);
++			r = do_read_pkcs12_private_key(filename,
++					passphrase, pk, certs, max_certs);
+ 		}
+ 	} else {
+ 		util_error("Error when reading private key. "
+-- 
+2.24.1
+
diff --git a/meta-oe/recipes-support/opensc/opensc_0.19.0.bb b/meta-oe/recipes-support/opensc/opensc_0.19.0.bb
index 006a1b6b29..0d744e213b 100644
--- a/meta-oe/recipes-support/opensc/opensc_0.19.0.bb
+++ b/meta-oe/recipes-support/opensc/opensc_0.19.0.bb
@@ -15,6 +15,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
 SRCREV = "f1691fc91fc113191c3a8aaf5facd6983334ec47"
 SRC_URI = "git://github.com/OpenSC/OpenSC \
            file://0001-Remove-redundant-logging.patch \
+           file://0001-Fix-misleading-code-indentation.patch \
           "
 DEPENDS = "virtual/libiconv openssl"