]> Sergey Matveev's repositories - nnn.git/commitdiff
Revert "malloc() mem those persist through program runtime"
authorKlzXS <klzx+github@klzx.cf>
Mon, 8 Nov 2021 14:08:12 +0000 (15:08 +0100)
committerKlzXS <klzx+github@klzx.cf>
Mon, 8 Nov 2021 14:08:12 +0000 (15:08 +0100)
This reverts commit b84ad2d552a81f4e4383e716cf0624e768839a7d.

src/nnn.c

index 7d37a2b0351e0381574d04173273482cfe99f54f..c7440149412d263e1e491835eef5545caf3f522c 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -6560,7 +6560,9 @@ static bool cdprep(char *lastdir, char *lastname, char *path, char *newpath)
 
 static bool browse(char *ipath, const char *session, int pkey)
 {
-       char *newpath = malloc(PATH_MAX), *rundir = malloc(PATH_MAX), *runfile = malloc(NAME_MAX + 1);
+       char newpath[PATH_MAX] __attribute__ ((aligned)),
+            rundir[PATH_MAX] __attribute__ ((aligned)),
+            runfile[NAME_MAX + 1] __attribute__ ((aligned));
        char *path, *lastdir, *lastname, *dir, *tmp;
        pEntry pent;
        enum action sel;
@@ -6720,7 +6722,7 @@ nochange:
 
                /* If STDIN is no longer a tty (closed) we should exit */
                if (!isatty(STDIN_FILENO) && !g_state.picker)
-                       return EXIT_FAILURE; // NOLINT
+                       return EXIT_FAILURE;
 
                sel = nextsel(presel);
                if (presel)