home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!olivea!sgigate!odin!fido!sam!pj
- From: pj@sam.wpd.sgi.com (Paul Jackson)
- Newsgroups: comp.sys.sgi
- Subject: Re: Ssanf gobbles source string ??
- Message-ID: <pdhad50@fido.asd.sgi.com>
- Date: 4 Sep 92 02:04:09 GMT
- References: <1992Sep3.153419.26116@magnus.acs.ohio-state.edu>
- Sender: news@fido.asd.sgi.com (Usenet News Admin)
- Organization: Silicon Graphics, Inc. Mountain View, CA
- Lines: 19
-
-
- In article <1992Sep3.153419.26116@magnus.acs.ohio-state.edu>, hshamans@magnus.acs.ohio-state.edu writes:
- > I'm wondering if the sscanf should *ever* modify the string from which
- > it is scanning.
- >
- > sscanf(test1,"%s %i",test2,&i);
- >
- > Before 2dfft 0
- > After 2dfft
-
- yep - a bug. The %i format of sscanf looks for "0x" and "0"
- prefixes, for hex and octal. In some cases, it uses ungetc
- to put back a character, if it sees "0" not followed by "x".
- The put back writes directly into the supposed input buffer.
-
- I have posted your report as an internal bug on sscanf,
- to be fixed sometime, though probably not at high priority.
-
- Thanks.
-