BUGFIX: l3_init can fail on desfire ev3 and produce SIGSEGV
[librfid] / src / rfid_proto_tcl.c
index af626c6..cfde04b 100644 (file)
@@ -16,7 +16,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
 #include <stdio.h>
@@ -164,6 +164,8 @@ tcl_parse_ats(struct rfid_protocol_handle *h,
 
        h->priv.tcl.historical_len = (ats+len) - cur;
        h->priv.tcl.historical_bytes = cur;
+       
+       DEBUGP("ATS parsed: %s\n", rfid_hexdump(ats, size));
 
        return 0;
 }
@@ -781,6 +783,8 @@ tcl_getopt(struct rfid_protocol_handle *h, int optname, void *optval,
                *optlen = sizeof(u_int8_t);
                *opt_str = h->priv.tcl.ats_len & 0xff;
                break;
+       default:
+               return -EINVAL;
        }
 
        return 0;