]> Sergey Matveev's repositories - nnn.git/commitdiff
Use local buffers for events
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Jun 2019 13:05:19 +0000 (18:35 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 5 Jun 2019 13:33:06 +0000 (19:03 +0530)
src/nnn.c

index ece9e63753aadd1e3453241db89ba29676f2c84d..3d2d46132b3f3cc1ad64acc49ac0fd7f810250e7 100644 (file)
--- 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