Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: comp.sys.amiga.tech Subject: Another Manx 5.0 bug (scanf) Message-ID: <4455@jhunix.HCF.JHU.EDU> Date: 10 Mar 90 01:04:20 GMT Organization: The Johns Hopkins University - HCF Lines: 40 scanf() and sscanf() do not work properly with Manx C 5.0a. I have not tested fscanf(). The problems are: (1) The functions do not return the correct value on bad inpu. (2) scanf() does not see EOF until you send it TWICE. Test program: #include main() { int i, result; result = scanf("%d", &i); printf("%d %d\n", result, i); } Compile: cc t.c Link: ln t.o -lc Run: t Give the input 'z' and scanf incorrectly returns 1, instead of 0. Type EOF (^\) and scanf ignores it. Type a second ^\ and scanf() sees it. How the HELL did a big error like this one get out?????????!?!?!?! Or am I doing something TOTALLY stupid??? I have submitted a bug report to Manx. Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////