From 6d0d32c8a0e3109b9a8cf507be0533c0be569cfe Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Wed, 19 May 2010 12:02:33 +1200 Subject: [PATCH] FET database bug fixes. --- fet.c | 6 ++---- fet_db.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fet.c b/fet.c index 8437480..7083cf5 100644 --- a/fet.c +++ b/fet.c @@ -501,10 +501,8 @@ static int do_identify(struct fet_device *dev, const char *force_id) printf("Device: %s\n", r->name); - if (xfer(dev, 0x2b, r->msg2b_data, FET_DB_MSG2B_LEN, 0) < 0) { - fprintf(stderr, "fet: message 0x2b failed\n"); - return -1; - } + if (xfer(dev, 0x2b, r->msg2b_data, FET_DB_MSG2B_LEN, 0) < 0) + fprintf(stderr, "fet: warning: message 0x2b failed\n"); if (xfer(dev, 0x29, r->msg29_data, FET_DB_MSG29_LEN, 3, r->msg29_params[0], r->msg29_params[1], diff --git a/fet_db.c b/fet_db.c index 42e71ec..d4be1a8 100644 --- a/fet_db.c +++ b/fet_db.c @@ -350,7 +350,6 @@ static const struct fet_db_record fet_db[] = { 0x00, 0x00 } } - }; const struct fet_db_record *fet_db_find_by_msg28(uint8_t *data, int len) @@ -384,7 +383,7 @@ const struct fet_db_record *fet_db_find_by_msg28(uint8_t *data, int len) } } - if (best) + if (best >= 0) return &fet_db[best]; return NULL;