From fd77ace55ce7e76383cd4e25a4e1e0d92743e11c Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Mon, 21 Oct 2024 11:51:39 +0200 Subject: [PATCH] fix sizeof usage (#30) --- camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camera.cpp b/camera.cpp index 78e3e0f..4b7ccb9 100644 --- a/camera.cpp +++ b/camera.cpp @@ -53,7 +53,7 @@ static const char *heap_positions[] = { // https://github.com/raspberrypi/rpicam-apps/blob/6de1ab6a899df35f929b2a15c0831780bd8e750e/core/dma_heaps.cpp static int create_dma_allocator() { - for (unsigned int i = 0; i < sizeof(heap_positions); i++) { + for (unsigned int i = 0; i < sizeof(heap_positions) / sizeof(const char *); i++) { int fd = open(heap_positions[i], O_RDWR | O_CLOEXEC, 0); if (fd >= 0) { return fd;