From de03989e864d7ef85d47e20a9d5440c5ae83aeb7 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 8 Jul 2005 02:01:07 +0000
Subject: [PATCH] add more int -> ssize_t line number fixes, plus one
 formatting fix

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2826 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog  |  7 ++++---
 src/nano.c | 15 ++++++++-------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 867a28ed..7eac5d27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,14 @@
 CVS code -
 - General:
 	- Miscellaneous comment fixes. (DLR)
+	- Fix a few last instances of the current line number's being
+	  saved as an int instead of a ssize_t.  Changes to
+	  renumber_all(), renumber(), do_alt_speller(), and
+	  backup_lines(). (DLR)
 - global.c:
   shortcut_init()
 	- Simplify wording of nano_gotoline_msg. (Jordi)
 - nano.c:
-  renumber_all(), renumber()
-	- When renumbering, properly use a ssize_t instead of an int.
-	  (DLR)
   do_verbatim_input()
 	- If constant cursor position display is on when we finish, make
 	  sure the cursor position is displayed properly. (DLR)
diff --git a/src/nano.c b/src/nano.c
index 81b05433..eb999c7e 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2322,9 +2322,9 @@ const char *do_int_speller(const char *tempfile_name)
  * otherwise the error string. */
 const char *do_alt_speller(char *tempfile_name)
 {
-    int alt_spell_status, lineno_save = current->lineno;
+    int alt_spell_status;
     size_t current_x_save = current_x, pww_save = placewewant;
-    ssize_t current_y_save = current_y;
+    ssize_t lineno_save = current->lineno, current_y_save = current_y;
     pid_t pid_spell;
     char *ptr;
     static int arglen = 3;
@@ -2365,7 +2365,8 @@ const char *do_alt_speller(char *tempfile_name)
 	spellargs[0] = strtok(alt_speller, " ");
 	while ((ptr = strtok(NULL, " ")) != NULL) {
 	    arglen++;
-	    spellargs = (char **)nrealloc(spellargs, arglen * sizeof(char *));
+	    spellargs = (char **)nrealloc(spellargs, arglen *
+		sizeof(char *));
 	    spellargs[arglen - 3] = ptr;
 	}
 	spellargs[arglen - 1] = NULL;
@@ -3010,12 +3011,12 @@ filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
     size_t i;
 	/* Generic loop variable. */
     size_t current_x_save = current_x;
-    int fl_lineno_save = first_line->lineno;
-    int edittop_lineno_save = edittop->lineno;
-    int current_lineno_save = current->lineno;
+    ssize_t fl_lineno_save = first_line->lineno;
+    ssize_t edittop_lineno_save = edittop->lineno;
+    ssize_t current_lineno_save = current->lineno;
 #ifndef NANO_SMALL
     bool old_mark_set = ISSET(MARK_ISSET);
-    int mbb_lineno_save = 0;
+    ssize_t mbb_lineno_save = 0;
     size_t mark_beginx_save = 0;
 
     if (old_mark_set) {
-- 
GitLab