FET database bug fixes.

This commit is contained in:
Daniel Beer 2010-05-19 12:02:33 +12:00
parent a87ad8b834
commit 6d0d32c8a0
2 changed files with 3 additions and 6 deletions

6
fet.c
View File

@ -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],

View File

@ -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;