aboutsummaryrefslogtreecommitdiff
path: root/scripts/generate_rust_analyzer.py
diff options
context:
space:
mode:
authorJustin Stitt <[email protected]>2024-03-05 23:34:42 +0000
committerMartin K. Petersen <[email protected]>2024-03-10 18:37:43 -0400
commit855ce06f9104e8b4b336807f3c941381bf845eb1 (patch)
tree2c89e37ccecd8cf6ef07bb08bbcc87db1b1bdf79 /scripts/generate_rust_analyzer.py
parent8fd4c9c8e1f33b76c02b0cb0421abafb1cf91e6b (diff)
scsi: wd33c93: Replace deprecated strncpy() with strscpy()
@p1 is assigned to @setup_buffer and then we manually assign a NUL-byte at the first index. This renders the following strlen() call useless. Moreover, we don't need to reassign p1 to setup_buffer for any reason -- neither do we need to manually set a NUL-byte at the end. strscpy() resolves all this code making it easier to read. Even considering the path where @str is falsey, the manual NUL-byte assignment is useless as setup_buffer is declared with static storage duration in the top-level scope which should NUL-initialize the whole buffer. Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Justin Stitt <[email protected]> Link: https://lore.kernel.org/r/20240305-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v3-7-5b78a13ff984@google.com Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions