From: Arun Prakash Jana Date: Tue, 29 Jan 2019 20:48:12 +0000 (+0530) Subject: Fix crash while writing selection to file X-Git-Tag: v2.3~64 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b7666a8d5c9aff8d43f57e58d106acf2611b65ff;p=nnn.git Fix crash while writing selection to file --- 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; }