Skip to content

Update filemonkeytest.c #5

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adiwillhit
Copy link

Changes in :

  1. "argc" to "argc -1" : changed error message to show the actual number of arguments received.
  2. Add a read_rand file check to prevent crashes if it fails to open.
  3. Prints an error message before exiting if any metric file fails to open.
  4. I used srand((unsinged int ) time (NULL) instead of srand(rand()) for better randomness.
  5. I also used snprintf() instead of sprintf() to avoid buffer overflows.

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

Successfully merging this pull request may close these issues.

1 participant