nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Splint finds errors in nano.c


From: Rocco Corsi
Subject: [Nano-devel] Splint finds errors in nano.c
Date: Fri, 01 Mar 2002 22:01:40 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901

I just found out that LClint is now called splint and decided to try it out.

It found many errors, but these two are the ones that could quickly and easily be identified as possible problems.

1) long int assigned to int; these are attached in the nano.c.diff file

2) On line 957 of nano.c; an unused or null if statement. As far as I can tell, it can be removed.

thats all for now

Rocco
Index: nano.c
===================================================================
RCS file: /cvsroot/nano/nano/nano.c,v
retrieving revision 1.234
diff -u -r1.234 nano.c
--- nano.c      27 Feb 2002 04:14:16 -0000      1.234
+++ nano.c      2 Mar 2002 02:53:37 -0000
@@ -367,7 +367,7 @@
 int renumber_all(void)
 {
     filestruct *temp;
-    long i = 1;
+    int i = 1;
 
     for (temp = fileage; temp != NULL; temp = temp->next) {
        temp->lineno = i++;
@@ -2218,7 +2218,8 @@
     return 1;
 #else
     int slen = 0;              /* length of combined lines on one line. */
-    int initial_y, kbinput = 0, totbak;
+    int initial_y, kbinput = 0;
+    long totbak;
     filestruct *initial = NULL, *tmpjust = NULL, *cutbak, *tmptop, *tmpbot;
 
     if (empty_line(current->data)) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]