Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: readonly strings vs. sscanf Message-ID: <10051@mimsy.UUCP> Date: 6 Jan 88 04:45:11 GMT References: <4668@pyr.gatech.EDU> <2046@haddock.ISC.COM> <400@uniq.UUCP> <633@mcdsun.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 13 In article <633@mcdsun.UUCP> fnf@mcdsun.UUCP (Fred Fish) writes: >I have a feeling [readonly strings are] going to break more code than >just the obvious stuff, including something deep in the bowels of stdio. [example of sscanf using ungetc to put back a character in a non-file `stream' causing segmentation fault deleted] This is easy to fix. The changes I made to 4.3BSD stdio to allow functions as streams also included something that happens to fix this as well as a nastier bug (one that might quiety corrupt a byte somewhere) involving unbuffered streams and low free memory. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris