From: Clemens Gruber Date: Mon, 22 Jan 2018 16:12:13 +0000 (+0100) Subject: gpiomon: initialize the active low variable X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=55d36adc16fa9e297c4d81ecbf8d41aa6b66de87;p=qemu-gpiodev%2Flibgpiod.git gpiomon: initialize the active low variable 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 Signed-off-by: Bartosz Golaszewski --- diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index ad25815..5e68a4f 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -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));