]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: fix possible use of uninitialized variable (gcc-4.9 warning fix)
authorAurelien Jacobs <redacted>
Sat, 5 Apr 2014 15:42:33 +0000 (17:42 +0200)
committerBert Vermeulen <redacted>
Sun, 6 Apr 2014 15:32:46 +0000 (17:32 +0200)
hardware/fx2lafw/protocol.c: In function 'fx2lafw_command_start_acquisition':
hardware/fx2lafw/protocol.c:113:7: warning: 'cmd.flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
   (cmd.flags & CMD_START_FLAGS_CLK_48MHZ) ? "48" : "30");
       ^

hardware/fx2lafw/protocol.c

index f4f23e3775dda667d4086fd19b7f84d5f4558b6d..a19b324311439ffa609c18392cecfc530054c090 100644 (file)
@@ -87,7 +87,7 @@ static int command_get_revid_version(libusb_device_handle *devhdl,
 SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
                uint64_t samplerate, gboolean samplewide)
 {
-       struct cmd_start_acquisition cmd;
+       struct cmd_start_acquisition cmd = { 0 };
        int delay = 0, ret;
 
        /* Compute the sample rate. */