lkmpg/examples
Bob Lee d1d2a2b031
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).
2024-10-07 12:05:43 +08:00
..
2024-04-21 01:12:33 +08:00
2023-10-08 17:14:09 +08:00
2024-10-04 19:08:50 +03:00
2022-02-21 00:53:29 +08:00
2024-04-16 02:38:07 +08:00
2024-02-01 15:09:23 +08:00
2024-04-16 06:19:52 +08:00
2024-04-21 01:09:28 +08:00
2024-10-06 14:25:49 +08:00
2024-10-07 12:05:43 +08:00
2023-10-08 17:14:09 +08:00
2023-10-07 16:32:26 +02:00
2021-08-08 01:24:59 +08:00
2024-04-16 06:24:06 +08:00
2021-09-04 17:53:29 +08:00
2024-10-05 12:01:45 +08:00
2022-04-19 01:54:24 +08:00
2022-04-19 01:54:24 +08:00