libftdi Archives

Subject: 1.0/examples/find_all: Don't return before cleanup

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Matthias Janke <matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Jun 2011 15:12:14 +0200
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 4ebeb81f7a59f0100b8f252415ef3b443f080687 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 28 Jun 2011 14:59:25 +0200
Subject: Don't return before cleanup

---
 examples/find_all.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/examples/find_all.c b/examples/find_all.c
index 7d1aab4..2f3b4e2 100644
--- a/examples/find_all.c
+++ b/examples/find_all.c
@@ -23,11 +23,10 @@ int main(void)
         return EXIT_FAILURE;
     }
 
-    if ((ret = ftdi_usb_find_all(&ftdic, &devlist, 0x0403, 0x6001)) < 0)
+    if ((ret = ftdi_usb_find_all(&ftdic, &devlist, 0x0403, 0x6010)) < 0)
     {
         fprintf(stderr, "ftdi_usb_find_all failed: %d (%s)\n", ret, 
ftdi_get_error_string(&ftdic));
         retval =  EXIT_FAILURE;
-        return retval;
         goto do_deinit;
     }
 
@@ -41,7 +40,6 @@ int main(void)
         {
             fprintf(stderr, "ftdi_usb_get_strings failed: %d (%s)\n", ret, 
ftdi_get_error_string(&ftdic));
             retval = EXIT_FAILURE;
-            return retval;
             goto done;
         }
         printf("Manufacturer: %s, Description: %s\n\n", manufacturer, 
description);
@@ -52,5 +50,5 @@ done:
 do_deinit:
     ftdi_deinit(&ftdic);
 
-    return EXIT_SUCCESS;
+    return retval;
 }
-- 
1.7.3.4


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • 1.0/examples/find_all: Don't return before cleanup, Uwe Bonnes <=