Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Oct 2002 08:43:27 +0100
From:      Oliver Braun <obraun@informatik.unibw-muenchen.de>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Steve Kargl <sgk@troutmask.apl.washington.edu>, freebsd-ports@FreeBSD.ORG
Subject:   Re: FILE *in = stdin problem in FreeBSD-current.
Message-ID:  <20021027074327.GA35627@informatik.unibw-muenchen.de>
In-Reply-To: <20021027005304.GB16148@xor.obsecurity.org>
References:  <20021026163320.GA28436@troutmask.apl.washington.edu> <20021027005304.GB16148@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--7AUc2qLy4jB3hD7Z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Kris Kennaway <kris@obsecurity.org> [2002-10-26 17:53 -0700]:
> On Sat, Oct 26, 2002 at 09:33:20AM -0700, Steve Kargl wrote:

> > Line 36 of dec10io.usr is "FILE *input=3Dstdin;". =20
> > stdio.h is properly included in the source where we have
> >=20
> > extern FILE *__stdinp;
> > #define stdin   __stdinp
> >=20
> > How is handled?

> You need to initialize the variable at runtime, not statically.  If
> the program contains main() you can do it then; if it's a library I
> don't know a good way to fix it.

If it's a library the only solution I know is to initialize the variable
with NULL and insert something like the following before *any* usage:

if (var =3D=3D NULL) {var =3D stdin;}

Don't know if it's sufficient in all cases.

Regards,
         Olli
--=20
{- IST & IIS _ INF _ UniBwM :: obraun@informatik.unibw-muenchen.de -}
{- Tele-Consulting GmbH     :: obraun@Tele-Consulting.com          -}
{- FreeBSD Commmitter       :: obraun@FreeBSD.org                  -}

--7AUc2qLy4jB3hD7Z
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)

iD8DBQE9u5kfwLFrfe8lsboRAupXAJwOy6sigmi8i574WbsUKuToBXwV4gCg1OaC
gswXBbocP5SeqEuFwn0vfjg=
=0ENs
-----END PGP SIGNATURE-----

--7AUc2qLy4jB3hD7Z--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021027074327.GA35627>