]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
getty: code cleanup, part 1
authorDag-Erling Smørgrav <des@FreeBSD.org>
Fri, 4 Nov 2022 13:23:33 +0000 (14:23 +0100)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Mon, 14 Nov 2022 11:22:42 +0000 (12:22 +0100)
commitd488e8d0372d5c79fb2cb1aa6c41a59fbfb62479
tree98452943cc8b6bd421cff23ca34886d4474029b3
parent312fa66091f9989e64370291e2482eab8d8ab013
getty: code cleanup, part 1

* Avoid unnecessary use of `unsigned char *`
* Use explicit casts when assigning `unsigned char *` to `char *` or vice versa
* Drop unused global variables (and fix memory leak in `gettable()`)
* Use `snprintf()` instead of `strcpy()` + `strcat()`
* Drop spurious braces in switch

Sponsored by: Klara, Inc.
Obtained from: Apple OSS Distributions (in part)
Differential Revision: https://reviews.freebsd.org/D37263

(cherry picked from commit 8ad7a14ab49b93240676e15f404354775be931f4)

getty: code cleanup, part 2

* Clean up whitespace
* Reindent

Sponsored by: Klara, Inc.

(cherry picked from commit f285f41498ebe0bfc1dbe47d67af12ec2d131521)

getty: Avoid NULL deref if stdin is not a tty.

Sponsored by: Klara, Inc.
Obtained from: Apple OSS Distributions
Differential Revision: https://reviews.freebsd.org/D37265

(cherry picked from commit eb4d86d529e2523a19fd7454976923319954a49d)
libexec/getty/chat.c
libexec/getty/extern.h
libexec/getty/init.c
libexec/getty/main.c
libexec/getty/subr.c