From bbb3104eaf61abea3bdc52e69288ab7e65f7d6f4 Mon Sep 17 00:00:00 2001 From: June Tate-Gans Date: Sun, 25 Apr 2021 14:31:45 -0500 Subject: [PATCH] g13d: Use C++11 iterator instead of a raw C loop Signed vs. unsigned types throwing all kinds of errors. --- g13d/g13.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/g13d/g13.cc b/g13d/g13.cc index ab6f08a..c72801d 100644 --- a/g13d/g13.cc +++ b/g13d/g13.cc @@ -221,10 +221,12 @@ void G13_Device::cleanup() { void G13_Manager::cleanup() { G13_LOG(info, "cleaning up"); - for (int i = 0; i < g13s.size(); i++) { - g13s[i]->cleanup(); - delete g13s[i]; + + for (auto device : g13s) { + device->cleanup(); + delete device; } + libusb_exit(ctx); }