From 09e4cf63bb098f2679b5b11adee104d2016d81d9 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 6 Dec 2020 09:00:03 +1000 Subject: [PATCH] analyse: correct the argument count index check --- emory/chunk/params.hpp | 2 +- tools/analyse.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/emory/chunk/params.hpp b/emory/chunk/params.hpp index 2dd4e06..41d67bf 100644 --- a/emory/chunk/params.hpp +++ b/emory/chunk/params.hpp @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2019, Danny Robson + * Copyright 2019-2020, Danny Robson */ #pragma once diff --git a/tools/analyse.cpp b/tools/analyse.cpp index ce15b64..8a0d419 100644 --- a/tools/analyse.cpp +++ b/tools/analyse.cpp @@ -8,6 +8,7 @@ #include "emory/chunk/map.hpp" #include "emory/chunk/params.hpp" +#include "emory/chunk/ostream.hpp" #include #include @@ -81,11 +82,11 @@ int main (int argc, char const **argv) } emory::chunk::params p = emory::chunk::DEFAULT_PARAMS; - if (argc > ARG_BITS) - p.window = cruft::parse::from_string (argv[ARG_WINDOW]); - if (argc > ARG_WINDOW) + if (argc > ARG_BITS + 1) + p.bits = cruft::parse::from_string (argv[ARG_WINDOW]); + if (argc > ARG_WINDOW + 1) p.window = cruft::parse::from_string (argv[ARG_BITS]); - if (argc > ARG_BITS) + if (argc > ARG_BITS + 1) p.minimum = cruft::parse::from_string (argv[ARG_MINIMUM]); std::cerr << p << '\n';