From f0734dae3e87a05ff4017d7d7a43f52950473a31 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 11 Mar 2018 11:33:57 +0100
Subject: [PATCH] cut: avoid calling renumber() on what might be NULL

This fixes https://savannah.gnu.org/bugs/?53317.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
---
 src/nano.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nano.c b/src/nano.c
index ad959256..1c7c4dec 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -357,8 +357,8 @@ void extract_buffer(filestruct **file_top, filestruct **file_bot,
 
 		delete_node(openfile->fileage);
 
-		/* Renumber, starting with the line after the original file_bot. */
-		renumber(file_bot_save->next);
+		/* Renumber, starting at the last line of the original buffer. */
+		renumber(file_bot_save);
 	}
 
 	/* Since the text has now been saved, remove it from the buffer. */
-- 
GitLab