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

Fix a wierd behavior of a function #272

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Commits on Oct 7, 2024

  1. Fix a weird behavior of a function

    The procfile_write prints the content what user writes into. However,
    when the content size is greater than or equal to PROCFS_MAX_SIZE,
    procfile_write will print nothing, because the index for appending the
    tail NULL character will be modulo to 0, which is an off-by-one error.
    
    This fixes the problem by changing the upper bound of procfs_buffer_size
    to (PROCFS_MAX_SIZE - 1), leaving one byte for NULL character. After
    the change, we can discard the modulo because the range of
    procfs_buffer_size is already between 0 and (PROCFS_MAX_SIZE - 1).
    NOVBobLee committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    d1d2a2b View commit details
    Browse the repository at this point in the history