sscanf always generates error condition
Geraldo Veiga
ilan343 at violet.berkeley.edu
Wed May 1 09:35:54 AEST 1991
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 <stdio.h>
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.
More information about the Comp.unix.programmer
mailing list