From 8d001ca95fb5e69695645150eb227c0a477778e4 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 9 Sep 2019 21:56:42 +0100 Subject: [PATCH] st/oxr: Even more fixes for system xdevs --- src/xrt/state_trackers/oxr/oxr_system.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xrt/state_trackers/oxr/oxr_system.c b/src/xrt/state_trackers/oxr/oxr_system.c index 4175d579d..8b494cceb 100644 --- a/src/xrt/state_trackers/oxr/oxr_system.c +++ b/src/xrt/state_trackers/oxr/oxr_system.c @@ -99,12 +99,12 @@ oxr_system_fill_in(struct oxr_logger *log, struct xrt_device **xdevs, size_t num_xdevs) { - size_t num_copy = min_size_t(ARRAY_SIZE(sys->xdevs), num_xdevs); + sys->num_xdevs = min_size_t(ARRAY_SIZE(sys->xdevs), num_xdevs); - for (uint32_t i = 0; i < num_copy; i++) { + for (uint32_t i = 0; i < sys->num_xdevs; i++) { sys->xdevs[i] = xdevs[i]; } - for (size_t i = num_copy; i < num_xdevs; i++) { + for (size_t i = sys->num_xdevs; i < num_xdevs; i++) { oxr_xdev_destroy(&xdevs[i]); }