Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize SaveLevelDataFile() in file.c & ./include/file.h #29

Open
de01dwc opened this issue Oct 1, 2024 · 0 comments
Open

Modernize SaveLevelDataFile() in file.c & ./include/file.h #29

de01dwc opened this issue Oct 1, 2024 · 0 comments

Comments

@de01dwc
Copy link
Contributor

de01dwc commented Oct 1, 2024

  • when constructing level name, move the levelName assignment to its own line for readability, then check for NULL
  • replace sprintf() calls with snprintf()
  • move DEBUG() call inside a codeblock for the preceeding if() statement
  • add type to for() loops, either type int or type size_t
  • refactor switch block to use ternary operators to improve readability
  • fclose() returns zero on success; updates if() to check for fclose() != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant