Path: utzoo!attcan!uunet!tektronix!reed!psu-cs!kirkenda From: kirkenda@psu-cs.UUCP (Steve Kirkendall) Newsgroups: comp.os.minix Subject: Re: What should [fs]scanf return? Summary: And another thing... Message-ID: <1523@psu-cs.UUCP> Date: 18 Jan 89 19:47:11 GMT References: <588@forty2.UUCP> Reply-To: kirkenda@psu-cs.UUCP (Steve Kirkendall) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 21 The following applies to MINIX-ST. The MINIX-PC crowd should probably worry about this too, though... Simon Poole is right; the scanf() functions do return unconventional (i.e. incorrect) values. Even worse though: The scanf() functions seem to use a defective version of ungetc(). I wrote a program (a font editor) that had to read in some hex numbers (the values of the font16[] and font8[] arrays from kernel/stfnt.c). Fscanf() was getting stuck in the middle of the file. On a hunch, I modified my program to print the value of ftell() wherever fscanf() failed. It was failing at file offsets 1024 and 12288 - both are block boundaries. The scanf() functions can't always handle block boundaries. My work-around was to use fgets() and sscanf(). BTW, is there any interest in new fonts for MINIX-ST? Should I post my font editor? Or mail it to somebody? -- "If I seem insensitive to what you're going through, keep in mind that's the way I am." -- Mr. Spock