From: Uwe Bonnes Date: Mon, 20 Jun 2011 12:50:16 +0000 (+0200) Subject: Remove some code duplication X-Git-Tag: v1.0rc1~128 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=23fc2fe3703ce3e01a2b15293e385fbec515a37a Remove some code duplication --- diff --git a/examples/eeprom.c b/examples/eeprom.c index e2c8052..8d74d2c 100644 --- a/examples/eeprom.c +++ b/examples/eeprom.c @@ -177,23 +177,13 @@ int main(int argc, char **argv) f, ftdi_get_error_string(ftdi)); exit(-1); } - f = ftdi_read_eeprom(ftdi); - if (f < 0) - { - fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n", - f, ftdi_get_error_string(ftdi)); - exit(-1); - } } - else + f = ftdi_read_eeprom(ftdi); + if (f < 0) { - f = ftdi_read_eeprom(ftdi); - if (f < 0) - { - fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n", - f, ftdi_get_error_string(ftdi)); - exit(-1); - } + fprintf(stderr, "ftdi_read_eeprom: %d (%s)\n", + f, ftdi_get_error_string(ftdi)); + exit(-1); }