From 88c978e8987ebf74e67334bc678172477e7c7609 Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Mon, 6 Nov 2023 17:02:02 +0100
Subject: [PATCH] Move `length` variable to proper scope

---
 hwb1/src/hwb1/MyApplet.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hwb1/src/hwb1/MyApplet.java b/hwb1/src/hwb1/MyApplet.java
index 366c9e9..296620c 100644
--- a/hwb1/src/hwb1/MyApplet.java
+++ b/hwb1/src/hwb1/MyApplet.java
@@ -65,7 +65,6 @@ public class MyApplet extends Applet {
      * @param apdu the incoming APDU
      */
     public void process(APDU apdu) {
-        short length;
         byte[] buffer = apdu.getBuffer();
         
         if (selectingApplet()) {
@@ -92,6 +91,8 @@ public class MyApplet extends Applet {
                     ISOException.throwIt(SW_PIN_VERIFICATION_REQUIRED);
                 }
                 else {
+                    short length;
+
                     switch (instruction) {
                         case 0x00:
                         case 0x04: