From 658f7e663016c930a2d114f6249d49353e3fd023 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 4 Jul 2005 03:26:43 +0000
Subject: [PATCH] minor variable tweaks

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

diff --git a/ChangeLog b/ChangeLog
index 45f6b9e8..a813278e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@ CVS code -
   do_verbatim_input()
 	- If constant cursor position display is on when we finish, make
 	  sure the cursor position is displayed properly. (DLR)
+  do_alt_speller()
+	- Rename variable msglen to msg_len, for consistency, and make
+	  it a size_t instead of an int.  Also remove unnecessary
+	  initialization of altspell_error. (DLR)
   allow_pending_sigwinch()
 	- Simplify by using the "?" operator instead of an if clause.
 	  (DLR)
diff --git a/src/nano.c b/src/nano.c
index 5da58473..b9a3ecd9 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2398,9 +2398,9 @@ const char *do_alt_speller(char *tempfile_name)
 
     if (!WIFEXITED(alt_spell_status) ||
 		WEXITSTATUS(alt_spell_status) != 0) {
-	char *altspell_error = NULL;
+	char *altspell_error;
 	char *invoke_error = _("Could not invoke \"%s\"");
-	int msglen = strlen(invoke_error) + strlen(alt_speller) + 2;
+	size_t msg_len = strlen(invoke_error) + strlen(alt_speller) + 2;
 
 #ifndef NANO_SMALL
 	/* Turn the mark back on if it was on before. */
@@ -2408,8 +2408,8 @@ const char *do_alt_speller(char *tempfile_name)
 	    SET(MARK_ISSET);
 #endif
 
-	altspell_error = charalloc(msglen);
-	snprintf(altspell_error, msglen, invoke_error, alt_speller);
+	altspell_error = charalloc(msg_len);
+	snprintf(altspell_error, msg_len, invoke_error, alt_speller);
 	return altspell_error;
     }
 
-- 
GitLab