Clean-up: lttng: silence warning in metadata command handler
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:43:16 +0000 (19:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:43:18 +0000 (19:43 -0400)
argv[0] is used before checking argc, resulting in a warning
that argv could be of zero-length.

This is not a reachable bug; it really is a false positive.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/metadata.c

index 663099dfd5c181f0827f44e1c6e1a338e2f5b9a1..e702c5ebaca50b6ee2f71e60b498ff57d714c352 100644 (file)
@@ -108,6 +108,7 @@ static int handle_command(const char **argv)
        }
 
        argc = count_arguments(argv);
+       assert(argc >= 1);
 
        cmd = &actions[i];
        while (cmd->func != NULL) {
This page took 0.026015 seconds and 4 git commands to generate.