* 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 8ad7a14ab4)
getty: code cleanup, part 2
* Clean up whitespace
* Reindent
Sponsored by: Klara, Inc.
(cherry picked from commit f285f41498)
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 eb4d86d529)