From b170298371e8c19f9c13b8e82cbdb3953a486e04 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 25 Aug 2024 18:37:13 +0530 Subject: [PATCH] Use string literal for NUL --- src/nnn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index 936e9c02..580c9a65 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -194,8 +194,6 @@ #define PROMPT ">>> " #undef NEWLINE #define NEWLINE "\n" -#undef NUL -#define NUL "\0" #define REGEX_MAX 48 #define ENTRY_INCR 64 /* Number of dir 'entry' structures to allocate per shot */ #define NAMEBUF_INCR 0x800 /* 64 dir entries at once, avg. 32 chars per file name = 64*32B = 2KB */ @@ -9054,7 +9052,7 @@ int main(int argc, char *argv[]) if (g_state.picker) { if (selbufpos) { fd = selpath ? open(selpath, O_WRONLY | O_CREAT | O_TRUNC, 0600) : STDOUT_FILENO; - if ((fd == -1) || (seltofile(fd, NULL, sepnul ? NUL : NEWLINE) != (size_t)(selbufpos))) + if ((fd == -1) || (seltofile(fd, NULL, sepnul ? "\0" : NEWLINE) != (size_t)(selbufpos))) xerror(); if (fd > 1)