From 3d6ccb57be9d2276daa24130c9391bc5d3bb9284 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 16 May 2018 16:24:06 +1000 Subject: [PATCH] tools: ptraccel-debug: fail for a sequence without events Found by scan-build, running ptraccel-debug --mode=sequence --nevents=5 would use garbage custom_deltas. Signed-off-by: Peter Hutterer --- tools/ptraccel-debug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/ptraccel-debug.c b/tools/ptraccel-debug.c index df583c35..a98b615d 100644 --- a/tools/ptraccel-debug.c +++ b/tools/ptraccel-debug.c @@ -399,6 +399,9 @@ main(int argc, char **argv) memset(custom_deltas, 0, sizeof(custom_deltas)); while (optind < argc) custom_deltas[nevents++] = strtod(argv[optind++], NULL); + } else if (mode == SEQUENCE) { + usage(); + return 1; } switch (mode) {