[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] segfault
From: |
Chris Allegretta |
Subject: |
Re: [Nano-devel] segfault |
Date: |
Wed, 6 Mar 2002 19:48:41 -0500 |
User-agent: |
Mutt/1.3.25i |
On Thu, Mar 07, 2002 at 12:10:40AM +0100, Jordi Mallach wrote:
> Hello,
>
> First 1.1.7 bug at the BTS.
>
> echo "set fill 72" > ~/.nanorc
>
> Hope this helps.
Argh. Bad idea to use a variable for both a loop statement and string
to int conversion :) Credited and committed to CVS.
Index: rcfile.c
===================================================================
RCS file: /cvsroot/nano/nano/rcfile.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- rcfile.c 3 Mar 2002 22:52:52 -0000 1.35
+++ rcfile.c 7 Mar 2002 00:46:17 -0000 1.36
@@ -1,4 +1,4 @@
-/* $Id: rcfile.c,v 1.35 2002/03/03 22:52:52 astyanax Exp $ */
+/* $Id: rcfile.c,v 1.36 2002/03/07 00:46:17 astyanax Exp $ */
/**************************************************************************
* rcfile.c *
* *
@@ -304,7 +304,7 @@
void parse_rcfile(FILE * rcstream)
{
char *buf, *ptr, *keyword, *option;
- int set = 0, i;
+ int set = 0, i, j;
buf = charalloc(1024);
while (fgets(buf, 1023, rcstream) > 0) {
@@ -382,22 +382,22 @@
if (!strcasecmp(rcopts[i].name, "fill")) {
#ifndef DISABLE_WRAPJUSTIFY
- if ((i = atoi(option)) < MIN_FILL_LENGTH) {
+ if ((j = atoi(option)) < MIN_FILL_LENGTH) {
rcfile_error(_
("requested fill size %d too
small"),
- i);
+ j);
} else
- fill = i;
+ fill = j;
#endif
} else
if (!strcasecmp(rcopts[i].name, "tabsize"))
{
- if ((i = atoi(option)) <= 0) {
+ if ((j = atoi(option)) <= 0) {
rcfile_error(_
("requested tab size %d too
small"),
- i);
+ j);
} else {
- tabsize = i;
+ tabsize = j;
}
#ifndef DISABLE_JUSTIFY
} else
Chris A
--
Chris Allegretta http://www.asty.org
"Share and Enjoy" - Douglas Adams, 1952 - 2001