Page MenuHomeFreeBSD

getty: code cleanup, part 1
ClosedPublic

Authored by des on Nov 4 2022, 1:33 PM.
Tags
None
Referenced Files
F120614306: D37263.id.diff
Thu, Jun 19, 3:01 PM
Unknown Object (File)
Wed, Jun 18, 10:03 AM
Unknown Object (File)
Tue, Jun 17, 7:17 PM
Unknown Object (File)
Sun, Jun 15, 4:22 AM
Unknown Object (File)
Sat, May 31, 8:15 PM
Unknown Object (File)
Apr 30 2025, 1:13 AM
Unknown Object (File)
Apr 27 2025, 12:01 PM
Unknown Object (File)
Mar 19 2025, 2:56 PM

Details

Summary
  • 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)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Nov 4 2022, 1:33 PM
allanjude added a subscriber: allanjude.

Reviewed by: allanjude

This revision is now accepted and ready to land.Nov 4 2022, 2:01 PM

If you intend to do more work on these files, I suggest improving the style before introducing more significant changes. There is a lot of inherited stylistic issues here, unfortunately.
I think you have a typo in the description and you meant "braces" - I meantion it just in case you planned to copy it to the commit message.

libexec/getty/chat.c
276

missed opportunity to improve formatting

This revision now requires review to proceed.Nov 4 2022, 2:18 PM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 4 2022, 2:21 PM
This revision was automatically updated to reflect the committed changes.