Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ames!haven!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Yet another sscanf buf in Think 4.0? Keywords: LSC scanf sscanf Think 4.0 bug Message-ID: <1989Nov3.032823.24210@eng.umd.edu> Date: 3 Nov 89 03:28:23 GMT Sender: news@eng.umd.edu (The News System) Reply-To: russotto@eng.umd.edu (Matthew T. Russotto) Organization: Merriversity of Uniland, College Purgatory Lines: 24 Has anyone else seen the bug in the 68881 ANSI library that causes the first two bytes after a float to be zeroed? It does not occur in the standard library. It is fully reproducable on my system with this program: static float setme; unsigned long getstrashed = 0xFFFFFFFF; char mystr[] = "1.0"; main() { printf("mystr %s, setme %f, getstrashed %08lX\n", mystr, setme, getstrashed); sscanf(mystr, "%f", &setme); printf("mystr %s, setme %f, getstrashed %08lX\n", mystr, setme, getstrashed); } Results with 68881 enabled, using ANSI-68881 library: mystr 1.0, setme 0, getstrashed FFFFFFFF mystr 1.0, setme 1, getstrashed 0000FFFF Results with 68881 disabled, using ANSI library mystr 1.0, setme 0, getstrashed FFFFFFFF mystr 1.0, setme 1, getstrashed FFFFFFFF (if this has been discussed before, I apologize) -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu rrn: newsgroup "junk" full --- rerouting to news.groups