From: NRK Date: Sat, 25 Dec 2021 04:37:53 +0000 (+0600) Subject: avoid doing arithmetic on void pointer X-Git-Tag: v4.5~41^2~2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=78c0d54400dd06efb8b954b888e2c085783033e9;p=nnn.git avoid doing arithmetic on void pointer --- diff --git a/src/nnn.c b/src/nnn.c index ea753d07..5c7358cd 100644 --- 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;