Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2001 08:27:38 -0500
From:      Chris Faulhaber <jedgar@fxp.org>
To:        Eric Melville <eric@meow.osd.bsdi.com>
Cc:        freebsd-audit@freebsd.org
Subject:   Re: [murray@osd.bsdi.com: Re: quick patch to window(1)]
Message-ID:  <20010328082738.A3405@sushi.44bsd.net>
In-Reply-To: <20010327092052.A56508@meow.osd.bsdi.com>; from eric@meow.osd.bsdi.com on Tue, Mar 27, 2001 at 09:20:52AM -0800
References:  <20010327092052.A56508@meow.osd.bsdi.com>

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

--y0ulUmNC+osPPQO6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 27, 2001 at 09:20:52AM -0800, Eric Melville wrote:
> % This is really simple and brain-dead, and it's mostly just to keep from
> % using mktemp(3) (which is deprecated, etc).
> %
> % Index: scanner.c
> % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> % RCS file: /home/ncvs/src/usr.bin/window/scanner.c,v
> % retrieving revision 1.3
> % diff -r1.3 scanner.c
> % 290c290
> % < 			    && (cx.x_val.v_str =3D str_cpy(buf)) =3D=3D 0) {
> % ---
> % > 			    && (cx.x_val.v_str =3D (void *)str_cpy(buf)) =3D=3D 0) {

Why the cast?  v_str (aka v_un.V_str) is char*, the same that str_cpy()
returns...

Of course, it would probably be better if the hand-rolled str_cpy()
and str_ncpy() went away and replaced with strdup()/strlcpy() and some
error checking (of which window(1) seems to do very little).

> % Index: wwterminfo.c
> % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> % RCS file: /home/ncvs/src/usr.bin/window/wwterminfo.c,v
> % retrieving revision 1.4
> % diff -r1.4 wwterminfo.c
> % 67,68c67
> % < 	mktemp(wwterminfopath);
> % < 	if (mkdir(wwterminfopath, 0755) < 0 ||
> % ---
> % > 	if (mkdtemp(wwterminfopath) < 0 ||
> %

Looks good.

--=20
Chris D. Faulhaber - jedgar@fxp.org - jedgar@FreeBSD.org
--------------------------------------------------------
FreeBSD: The Power To Serve   -   http://www.FreeBSD.org

--y0ulUmNC+osPPQO6
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: FreeBSD: The Power To Serve

iEYEARECAAYFAjrB5soACgkQObaG4P6BelACHQCdEaxtM4CmDFmNthyh3x8TXuWU
xXkAnj6bfq2ZkqjUkxZjECiTOYCI3v1M
=p+gx
-----END PGP SIGNATURE-----

--y0ulUmNC+osPPQO6--

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




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