Path: utzoo!attcan!uunet!tank!ux1.cso.uiuc.edu!uwm.edu!wuarchive!psuvax1!rutgers!cmcl2!lanl!opus!jthomas From: jthomas@nmsu.edu (James Thomas) Newsgroups: comp.sys.hp Subject: Extraneous error code under 3.1? Message-ID: Date: 17 Nov 89 23:20:45 GMT Sender: news@nmsu.edu Distribution: comp Organization: NMSU Computer Science Lines: 27 System: HP 9000/840 under HP-UX 3.1 When we run the following code in either form (with the fgets or fscanf), the first fgets/fscanf call returns an error code of 25 . If that is cleared, following calls do not touch errno . Would someone else please try this and report back your results? Thank you, Jim Thomas ------------------------------ 8< ------------------------------ #include extern int errno; main () { FILE* fd; char s[20]; fd = fopen ("tmp","r"); printf("using fscanf errno = %d",errno); /* fgets(s,20,fd); */ fscanf(fd,"%s",s); printf("\n after read errno = %d\n",errno); printf(" string is %s\n",s); }