]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tipc: Removing deprecated strncpy()
authorKevin Paul Reddy Janagari <kevinpaul468@gmail.com>
Fri, 11 Apr 2025 08:50:10 +0000 (14:20 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 15 Apr 2025 11:37:14 +0000 (13:37 +0200)
commit8c9b406ff470a8346232eec979dc84f518aabfd9
tree0f4475ef2f78d4fc2c02c1ea5351569529a0d36b
parent4c2e0b00b51f2e4647d3285910ed28ab703dab1a
tipc: Removing deprecated strncpy()

This patch suggests the replacement of strncpy with strscpy
as per Documentation/process/deprecated.
The strncpy() fails to guarantee NULL termination,
The function adds zero pads which isn't really convenient for short strings
as it may cause performance issues.

strscpy() is a preferred replacement because
it overcomes the limitations of strncpy mentioned above.

Compile Tested

Signed-off-by: Kevin Paul Reddy Janagari <kevinpaul468@gmail.com>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Tested-by: Tung Nguyen <tung.quang.nguyen@est.tech>
Link: https://patch.msgid.link/20250411085010.6249-1-kevinpaul468@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/tipc/link.c
net/tipc/node.c