]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fdwrite.c: initialize pointers to NULL and a few other cleanups
authorrilysh <nightquick@proton.me>
Thu, 11 Apr 2024 18:23:33 +0000 (12:23 -0600)
committerWarner Losh <imp@FreeBSD.org>
Thu, 11 Apr 2024 18:24:36 +0000 (12:24 -0600)
commit16e5eb212fb8e054513adafa6c44db23f27dbb46
treee2924e9355e4641c18e9bcd60bcd9ef55373e4e0
parent215c0a5158f17f515f365fc28a9ff0b367be8fc9
fdwrite.c: initialize pointers to NULL and a few other cleanups

1. Both trackbuf and vrfybuf are initialized to
zero (NULL). While it's okay to initialize pointers
to zero, to keep consistency, as they're explicitly
pointers, it's better to just use NULL ((void *)0)
instead of 0 (both are equivalent to the compilers).

2. Call free() for both trackbuf and vrfybuf after
their job has been done.

3. Remove the register keyword. Compilers generally
ignore this keyword (except for very very old compilers
and CPUs).

4. Remove the ctype.h header. It's not being used
anywhere in the file.

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1059
usr.sbin/fdwrite/fdwrite.c