Page MenuHomeFreeBSD

getty: code cleanup, part 1
ClosedPublic

Authored by des on Nov 4 2022, 1:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 23, 7:00 AM
Unknown Object (File)
Mon, Mar 23, 1:36 AM
Unknown Object (File)
Sun, Mar 22, 6:36 AM
Unknown Object (File)
Sat, Mar 21, 10:07 AM
Unknown Object (File)
Sat, Mar 21, 10:07 AM
Unknown Object (File)
Wed, Mar 18, 2:25 AM
Unknown Object (File)
Tue, Mar 17, 8:39 PM
Unknown Object (File)
Sun, Mar 15, 6:28 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.