From: Uwe Bonnes Date: Mon, 20 Jun 2011 14:03:53 +0000 (+0200) Subject: Clean up in error pathes X-Git-Tag: v1.0rc1~124 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=bd4a9e3887010062474a368c8eee6f9e4ce012b4 Clean up in error pathes --- diff --git a/examples/eeprom.c b/examples/eeprom.c index 1a11e3b..022cf03 100644 --- a/examples/eeprom.c +++ b/examples/eeprom.c @@ -26,6 +26,7 @@ int main(int argc, char **argv) int do_write = 0; int size; int value; + int retval = 0; if ((ftdi = ftdi_new()) == 0) { @@ -74,7 +75,8 @@ int main(int argc, char **argv) "product description\n"); fprintf(stderr, "\t-S type, value); @@ -222,10 +232,11 @@ int main(int argc, char **argv) { fprintf(stderr, "ftdi_eeprom_decode: %d (%s)\n", f, ftdi_get_error_string(ftdi)); - exit(-1); + retval = -1; } +done: ftdi_usb_close(ftdi); ftdi_free(ftdi); - return 0; + return retval; }