From: Bartosz Golaszewski Date: Fri, 10 Mar 2023 08:49:41 +0000 (+0100) Subject: bindings: cxx: examples: reserve correct amount of space for offsets X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=800868885331060e3c797488758c0cd89dfbe1ce;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: examples: reserve correct amount of space for offsets In gpiomoncxx we only need to reserve space for (argc - 2) offsets. Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/examples/gpiomoncxx.cpp b/bindings/cxx/examples/gpiomoncxx.cpp index 4f765ba..7dc20c4 100644 --- a/bindings/cxx/examples/gpiomoncxx.cpp +++ b/bindings/cxx/examples/gpiomoncxx.cpp @@ -38,7 +38,7 @@ int main(int argc, char **argv) } ::gpiod::line::offsets offsets; - offsets.reserve(argc); + offsets.reserve(argc - 2); for (int i = 2; i < argc; i++) offsets.push_back(::std::stoul(argv[i]));