Skip to content

Commit

Permalink
Use string literal for NUL
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Aug 25, 2024
1 parent ddbd15f commit b170298
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b170298

Please sign in to comment.