From b7666a8d5c9aff8d43f57e58d106acf2611b65ff Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 30 Jan 2019 02:18:12 +0530 Subject: [PATCH] Fix crash while writing selection to file --- src/nnn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 5f3c11e5..9bf8e6c8 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -818,7 +818,7 @@ static ssize_t selectiontofd(int fd) if (pos <= lastpos) { if (write(fd, "\n", 1) != 1) return pos; - pbuf += pos + 1; + pbuf += len + 1; } ++pos; }