[PATCH] [libgpiod] gpiomon: initialize the active low variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 src/tools/gpiomon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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));
-- 
2.16.0

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux