gpiomon: initialize the active low variable
authorClemens Gruber <clemens.gruber@pqgruber.com>
Mon, 22 Jan 2018 16:12:13 +0000 (17:12 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Tue, 23 Jan 2018 10:10:49 +0000 (11:10 +0100)
The variable active_low is not initialized, so the value is undefined
and if the -l argument is not passed, the undefined value remains. Fix
it by initializing it to false.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/tools/gpiomon.c

index ad258158938fe84a9c7ae03acc09952a51fcc3a0..5e68a4f50203bba45828afe7bf3c6381905b34ee 100644 (file)
@@ -249,9 +249,9 @@ int main(int argc, char **argv)
        unsigned int offsets[GPIOD_LINE_BULK_MAX_LINES];
        struct timespec timeout = { 10, 0 };
        unsigned int num_lines = 0, offset;
+       bool active_low = false;
        int optc, opti, ret, i;
        struct mon_ctx ctx;
-       bool active_low;
        char *end;
 
        memset(&ctx, 0, sizeof(ctx));