commit 78c0d54400dd06efb8b954b888e2c085783033e9
parent e44f8d3fccf16103a5b546a8c888ea799735ed4d
Author: NRK <nrk@disroot.org>
Date: Sat, 25 Dec 2021 10:37:53 +0600
avoid doing arithmetic on void pointer
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nnn.c b/src/nnn.c
@@ -7971,9 +7971,9 @@ static char *load_input(int fd, const char *path)
++chunk_count;
while (off < total_read) {
- next = memchr(input + off, '\0', total_read - off) + 1;
- if (next == (void *)1)
+ if ((next = memchr(input + off, '\0', total_read - off)) == NULL)
break;
+ ++next;
if (next - input == off + 1) {
off = next - input;