home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.gtech.com!noc.near.net!news.bbn.com!olivea!spool.mu.edu!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.harris.com!travis.csd.harris.com!grouper!!brent
- From: brent@ssd.csd.harris.com (Brent Benson)
- Newsgroups: comp.os.linux
- Subject: Re: minicom broken under .98-5
- Message-ID: <BRENT.92Nov17090327@amber.ssd.csd.harris.com>
- Date: 17 Nov 92 14:03:27 GMT
- References: <1992Nov17.062728.28748@magnus.acs.ohio-state.edu>
- Sender: news@grouper.mkt.csd.harris.com (Network News)
- Organization: Harris Computer Systems
- Lines: 26
- In-Reply-To: dohm@magnus.acs.ohio-state.edu's message of Tue, 17 Nov 1992 06:27:28 GMT
-
- dohm@magnus.acs.ohio-state.edu (Peter J Dohm) writes:
-
- > I have discovered that Minicom has broken in numerous ways due to
- > the new text segment protection. For one, there was a line in
- > function win_init in window.c that had:
-
- > char *gname = "stuff"
- > gname[1]='x'; this seg faulted... (no kidding, right?)
-
- > it needed to be changed to something like:
-
- > char *gname;
- > gname=(char *)malloc(2);
- > strcpy(gname,"whatever");
-
- You don't have to go to such lengths to do this sort of thing. Simply
- use an initialized array of characters rather than a pointer to a
- string constant:
-
- char gname[] = "stuff";
-
- is guaranteed to be writable in ANSI C.
-
- --
- Brent Benson
- Harris Computer Systems
-