home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!unidui!Germany.EU.net!mcsun!news.funet.fi!funic!nntp.hut.fi!nntp!jem
- From: jem@snakemail.hut.fi (Johan Myreen)
- Subject: Re: minicom broken under .98-5
- In-Reply-To: dohm@magnus.acs.ohio-state.edu's message of Tue, 17 Nov 1992 06:27:28 GMT
- Message-ID: <JEM.92Nov17121516@lk-hp-6.hut.fi>
- Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
- Nntp-Posting-Host: lk-hp-6.hut.fi
- Organization: Helsinki University of Technology, Finland
- References: <1992Nov17.062728.28748@magnus.acs.ohio-state.edu>
- Date: 17 Nov 92 10:15:16 GMT
- Lines: 28
-
- In article <1992Nov17.062728.28748@magnus.acs.ohio-state.edu> dohm@magnus.acs.ohio-state.edu (Peter J Dohm) writes:
-
- >text segment protection. For one, there was a line in function win_init
- >in window.c that had:
- >char *gname = "stuff"
- >then later:
- >gname[1]='x';
- >this seg faulted... (no kidding, right?)
-
- >it needed to be changed to something like:
- >char *gname;
- >gname=(char *)malloc(2); (the original string was 2 bytes in length)
- >strcpy(gname,"whatever"); (take the original string in the declaration and
-
- Ugh. Simply doing this would have solved the problem:
-
- char gname[] = "stuff";
-
- (Well, unless gname really has to be a pointer... Poor coding style in
- Minicom, anyway)
-
- This declares a char array initialized with the string, as opposed to
- declaring a pointer variable initialized with a pointer to a string
- literal.
-
- --
- Johan Myreen
- jem@cs.hut.fi
-