examples/async.c: fix sometimes-uninitialized warning
authorYegor Yefremov <yegorslists@googlemail.com>
Wed, 4 Jun 2025 06:47:05 +0000 (08:47 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 10 Jun 2025 14:43:11 +0000 (16:43 +0200)
Initialize retval with EXIT_SUCCESS. Otherwise, if there are no errors,
this variable stays uninitialized.

examples/async.c

index 241bb7f..4fc9631 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
     struct ftdi_context *ftdi;
     int do_read = 0;
     int do_write = 0;
-    int i, f, retval;
+    int i, f, retval = EXIT_SUCCESS;
 
     if ((ftdi = ftdi_new()) == 0)
     {