home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / linux / 16966 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.4 KB

  1. 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
  2. From: brent@ssd.csd.harris.com (Brent Benson)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: minicom broken under .98-5
  5. Message-ID: <BRENT.92Nov17090327@amber.ssd.csd.harris.com>
  6. Date: 17 Nov 92 14:03:27 GMT
  7. References: <1992Nov17.062728.28748@magnus.acs.ohio-state.edu>
  8. Sender: news@grouper.mkt.csd.harris.com (Network News)
  9. Organization: Harris Computer Systems
  10. Lines: 26
  11. In-Reply-To: dohm@magnus.acs.ohio-state.edu's message of Tue, 17 Nov 1992 06:27:28 GMT
  12.  
  13. dohm@magnus.acs.ohio-state.edu (Peter J Dohm) writes:
  14.  
  15. > I have discovered that Minicom has broken in numerous ways due to
  16. > the new text segment protection.  For one, there was a line in
  17. > function win_init in window.c that had:
  18.  
  19. > char *gname = "stuff"
  20. > gname[1]='x'; this seg faulted... (no kidding, right?)
  21.  
  22. > it needed to be changed to something like:
  23.  
  24. > char *gname;
  25. > gname=(char *)malloc(2);
  26. > strcpy(gname,"whatever");
  27.  
  28. You don't have to go to such lengths to do this sort of thing.  Simply
  29. use an initialized array of characters rather than a pointer to a
  30. string constant:
  31.  
  32. char gname[] = "stuff";
  33.  
  34. is guaranteed to be writable in ANSI C.
  35.  
  36. --
  37. Brent Benson                     
  38. Harris Computer Systems
  39.