Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!uwm.edu!bionet!agate!violet.berkeley.edu!ilan343 From: ilan343@violet.berkeley.edu (Geraldo Veiga) Newsgroups: comp.unix.programmer Subject: sscanf always generates error condition Message-ID: <1991Apr30.233554.1321@agate.berkeley.edu> Date: 30 Apr 91 23:35:54 GMT Sender: root@agate.berkeley.edu (Charlie Root) Distribution: usa Organization: University of California, Berkeley Lines: 21 Is there a good reason why "sscanf" under ISC 2.2 always sets "errno=9" even though it executed successfully? This is an example: #include extern int errno; char s[] = "10000"; main () { int tmp; sscanf(s,"%d",&tmp); perror("System error"); } This is the output of the above code: System error: Bad file number (This message corresponds to errno=9) If this a bug? BSD's sscanf doesn't display this behavior.