delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/01/16/22:15:38

Date: Sun, 16 Jan 94 22:05:10 EST
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: fcloseall
Reply-To: babcock AT cfa DOT harvard DOT edu

I notice that there is an fcloseall() in stdio.h and in the library sources.
But, it is not documented in libcfef.i and worse, the code looks wrong.
A brief excerpt:

static void fcloseall_helper(FILE *f)
{
  if (f >= stdin || f <= stdprn)    <-- shouldn't this be && rather than ||
    return;
  fclose(f);

Given the definitions of stdin and stdprn from stdio.h, I don't think that
fcloseall will close anything.

#define stdin     (&_iob[0])
#define stdprn    (&_iob[4])

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019