mifare classic:
[librfid] / src / rfid_reader.c
index a5dbeb2..e0f0d3d 100644 (file)
@@ -14,7 +14,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 <stdlib.h>
@@ -26,7 +26,7 @@
 #include <librfid/rfid_reader_openpcd.h>
 
 static const struct rfid_reader *rfid_readers[] = {
-#ifndef LIBRFID_FIRMWARE
+#ifdef ENABLE_CM5121
        [RFID_READER_CM5121]    = &rfid_reader_cm5121,
 #endif
        [RFID_READER_OPENPCD]   = &rfid_reader_openpcd,
@@ -43,6 +43,8 @@ rfid_reader_open(void *data, unsigned int id)
        }
 
        p = rfid_readers[id];
+       if (!p)
+               return NULL;
 
        return p->open(data);
 }