From 1dbbcac84f9405feaefa57527fa5e2a754332984 Mon Sep 17 00:00:00 2001
From: Arun Prakash Jana <engineerarun@gmail.com>
Date: Wed, 5 Jun 2019 18:35:19 +0530
Subject: [PATCH] Use local buffers for events

---
 src/nnn.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c
index ece9e637..3d2d4613 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1491,10 +1491,10 @@ static int nextsel(int presel)
 	const uint len = LEN(bindings);
 #ifdef LINUX_INOTIFY
 	struct inotify_event *event;
-	char *inotify_buf = alloca(EVENT_BUF_LEN);
+	char inotify_buf[EVENT_BUF_LEN];
 	memset((void *)inotify_buf, 0x0, EVENT_BUF_LEN);
 #elif defined(BSD_KQUEUE)
-	struct kevent *event_data = alloca(sizeof(struct kevent) * NUM_EVENT_SLOTS);
+	struct kevent event_data[NUM_EVENT_SLOTS];
 	memset((void *)event_data, 0x0, sizeof(struct kevent) * NUM_EVENT_SLOTS);
 #endif
 
-- 
2.51.0