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)
Mar 4 2024, 12:39 PM
Unknown Object (File)
Jan 28 2024, 6:20 AM
Unknown Object (File)
Dec 20 2023, 6:17 AM
Unknown Object (File)
Dec 16 2023, 4:56 AM
Unknown Object (File)
Dec 12 2023, 1:16 PM
Unknown Object (File)
Dec 3 2023, 11:32 AM
Unknown Object (File)
Nov 30 2023, 5:15 PM
Unknown Object (File)
Nov 30 2023, 5:15 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.